[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[SCM] Debian package checker branch, master, updated. 2.5.15-12-g46cdb44



The following commit has been merged in the master branch:
commit 46cdb44ad39b9c8433bc3dd02d98d3e834c4732c
Author: Niels Thykier <niels@thykier.net>
Date:   Sun Jul 28 00:20:55 2013 +0200

    c/po-debconf.pm: Check for real comments before _Default
    
    Signed-off-by: Niels Thykier <niels@thykier.net>

diff --git a/checks/po-debconf.desc b/checks/po-debconf.desc
index d6e45f4..74fae9d 100644
--- a/checks/po-debconf.desc
+++ b/checks/po-debconf.desc
@@ -123,11 +123,20 @@ Certainty: possible
 Info: You should not mark as translatable "Default:" or "DefaultChoice:"
  fields, unless explicitly needed (e.g. default country, default language,
  etc.).  If this Default field really should be translated, you should
- explain translators how they should translate it by using brackets.  For
- example:
+ explain translators how they should translate it by using comments or
+ brackets.  For example:
+ .
+   # Translators: Default language name, but not translated
+   _Default: English
+ .
+ Or:
  .
    _Default: English[ Default language name, but not translated]
-Ref: po-debconf(7)
+ .
+ Note that in the first case, Lintian ignores the comment unless it
+ explicitly references translators and it is appears directly before
+ the field in question.
+Ref: po-debconf(7), #637881
 
 Tag: no-complete-debconf-translation
 Severity: wishlist
diff --git a/checks/po-debconf.pm b/checks/po-debconf.pm
index ac6c1b8..d243dfb 100644
--- a/checks/po-debconf.pm
+++ b/checks/po-debconf.pm
@@ -54,11 +54,23 @@ for my $file (readdir($dirfd)) {
         } else {
             open(my $fd, '<', "$debfiles/$file");
             my $in_template = 0;
+            my $saw_tl_note = 0;
             while (<$fd>) {
                 tag 'translated-default-field', "$file: $."
-                    if (m{^_Default(?:Choice)?: [^\[]*$});
+                    if (m{^_Default(?:Choice)?: [^\[]*$}) && !$saw_tl_note;
                 tag 'untranslatable-debconf-templates', "$file: $."
                     if (m/^Description: (.+)/i and $1 !~/for internal use/);
+
+                if (/^#/) {
+                    # Is this a comment for the translators?
+                    $saw_tl_note = 1 if m/translators/i;
+                    next;
+                }
+
+                # If it is not a continuous comment immediately before the
+                # _Default(Choice) field, we don't care about it.
+                $saw_tl_note = 0;
+
                 if (/^Template: (\S+)/i) {
                     my $template = $1;
                     next if $template =~ m,^shared/packages-(wordlist|ispell)$,;
diff --git a/debian/changelog b/debian/changelog
index 41cfb8b..7744bb0 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -10,6 +10,10 @@ lintian (2.5.16) UNRELEASED; urgency=low
   * checks/init.d.{desc,pm}:
     + [NT] Revert init.d-script-call-internal-API for now.
       Refer to #710559 for more information.
+  * checks/po-debconf.{desc,pm}:
+    + [NT] Fix false-positive translated-default-field for
+      fields preceeded by a "true" Deb822 comment.  Thanks
+      to Ron Lee for the report.  (Closes: #637881)
   * checks/scripts.pm:
     + [NT] Stop emitting package-uses-local-diversion for
       calls to dpkg-divert without --package as dpkg 1.16.0

-- 
Debian package checker


Reply to: