diff options
author | Danilo Šegan <danilo@canonical.com> | 2010-03-17 18:59:05 +0100 |
---|---|---|
committer | Danilo Šegan <danilo@canonical.com> | 2010-03-17 18:59:05 +0100 |
commit | a208cf58d30fbf5b29141a5fc41030225f92f92c (patch) | |
tree | f25e6b82ae08659a049d244f66cc59dfa5e996f2 | |
parent | 021f1265c0d585f914d3eb743ed1f03d11a289a0 (diff) | |
download | intltool-a208cf58d30fbf5b29141a5fc41030225f92f92c.tar.gz |
Fix bug 514295: intltool-update -m failure 'make check' when building with builddir != srcdir.
-rw-r--r-- | intltool-update.in | 47 |
1 files changed, 25 insertions, 22 deletions
diff --git a/intltool-update.in b/intltool-update.in index 7488773..bdd4a0a 100644 --- a/intltool-update.in +++ b/intltool-update.in @@ -323,6 +323,24 @@ sub removeFromArray } } +sub AddFileToListIfMissing +{ + my ($file, @list) = @_; + + my $name_pattern; + if ($file =~ /^\.\.\//) { + $name_pattern = "x3 A*"; + } else { + $name_pattern = "A*"; + } + + my $file_name = unpack($name_pattern, $file); + if (defined isNotValidMissing ($file_name)) { + ## Remove the first 3 chars if needed and add newline + push @list, $file_name . "\n"; + } +} + sub FindLeftoutFiles { my (@buf_i18n_plain, @@ -489,34 +507,25 @@ sub FindLeftoutFiles s-$match.*--; } } - } + } if (/\w\.GetString *\(QUOTEDTEXT/) { - if (defined isNotValidMissing (unpack("x3 A*", $file))) { - ## Remove the first 3 chars and add newline - push @buf_allfiles, unpack("x3 A*", $file) . "\n"; - } + AddFileToListIfMissing($file, @buf_allfiles); last; } ## C_ N_ NC_ Q_ and _ are the macros defined in gi8n.h if (/(NC_|[NCQ]_|[^_]_|$_) *\(QUOTEDTEXT/) { - if (defined isNotValidMissing (unpack("x3 A*", $file))) { - ## Remove the first 3 chars and add newline - push @buf_allfiles, unpack("x3 A*", $file) . "\n"; - } + AddFileToListIfMissing($file, @buf_allfiles); last; } # Check for direct calls to the glib gettext wrappers if (/g_d[np]?gettext[2]? *\(QUOTEDTEXT/) { - if (defined isNotValidMissing (unpack("x3 A*", $file))) { - ## Remove the first 3 chars and add newline - push @buf_allfiles, unpack("x3 A*", $file) . "\n"; - } + AddFileToListIfMissing($file, @buf_allfiles); last; } } @@ -532,9 +541,7 @@ sub FindLeftoutFiles # FIXME: share the pattern matching code with intltool-extract if (/\s_[-A-Za-z0-9._:]+\s*=\s*\"([^"]+)\"/ || /<_[^>]+>/ || /translatable=\"yes\"/) { - if (defined isNotValidMissing (unpack("x3 A*", $file))) { - push @buf_allfiles, unpack("x3 A*", $file) . "\n"; - } + AddFileToListIfMissing($file, @buf_allfiles); last; } } @@ -548,9 +555,7 @@ sub FindLeftoutFiles { if (/_(.*)=/) { - if (defined isNotValidMissing (unpack("x3 A*", $file))) { - push @buf_allfiles, unpack("x3 A*", $file) . "\n"; - } + AddFileToListIfMissing($file, @buf_allfiles); last; } } @@ -559,9 +564,7 @@ sub FindLeftoutFiles foreach my $file (@buf_i18n_xml_unmarked) { - if (defined isNotValidMissing (unpack("x3 A*", $file))) { - push @buf_allfiles, unpack("x3 A*", $file) . "\n"; - } + AddFileToListIfMissing($file, @buf_allfiles); } |