Author: Guillem Jover <guillem@debian.org>
Debbug: 775708
Status: sent
Last-Change: 2015-01-19
Description: Please add support for new gettext --add-location option


Index: lib/Locale/Po4a/Po.pm
===================================================================
--- lib/Locale/Po4a/Po.pm	(revision 2764)
+++ lib/Locale/Po4a/Po.pm	(working copy)
@@ -190,11 +190,11 @@
             $self->{options}{$opt} = $options->{$opt};
         }
     }
-    $self->{options}{'porefs'} =~ /^(full|counter|noline|none)(,(no)?wrap)?$/ ||
+    $self->{options}{'porefs'} =~ /^(full|counter|noline|file|none)(,(no)?wrap)?$/ ||
         die wrap_mod("po4a::po",
                      dgettext ("po4a",
                                "Invalid value for option 'porefs' ('%s' is ".
-                               "not one of 'full', 'counter', 'noline' or 'none')"),
+                               "not one of 'full', 'counter', 'noline', 'file' or 'none')"),
                      $self->{options}{'porefs'});
     if ($self->{options}{'porefs'} =~ m/^counter/) {
         $self->{counter} = {};
@@ -1275,6 +1275,8 @@
         }
     } elsif ($self->{options}{'porefs'} =~ m/^noline/) {
         $reference =~ s/:\d+/:1/g;
+    } elsif ($self->{options}{'porefs'} =~ m/^file/) {
+        $reference =~ s/:\d+//g;
     }
 
     if (defined($self->{po}{$msgid})) {
Index: po4a
===================================================================
--- po4a	(revision 2764)
+++ po4a	(working copy)
@@ -686,6 +686,8 @@
     $opts{"verbose"} = 0 if $opts{"quiet"};
     $opts{"verbose"} ||= 1 if $opts{"debug"};
     $opts{"msgmerge-opt"} .= " --previous" unless $noprevious;
+    $opts{"msgmerge-opt"} .= " --add-location=file"
+        if $opts{"porefs"} =~ m/^file/;
 
     # options to transmit to the modules
     $opts{"options"} = {
