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

[SCM] Debian package checker branch, master, updated. 3cd9db4d8ec7b0c3d77b76950f31ee775a5ce6ce



The following commit has been merged in the master branch:
commit 3cd9db4d8ec7b0c3d77b76950f31ee775a5ce6ce
Author: Adam D. Barratt <adam@adam-barratt.org.uk>
Date:   Tue Jul 1 19:27:51 2008 +0100

    Suggest replacing "_Choices" in debconf templates files with "__Choices"
    
      * checks/debconf{,.desc}:
        + [ADB] Warn about the use of "_Choices" in templates file and suggest
          using "__Choices" instead (Closes: #481152)

diff --git a/checks/debconf b/checks/debconf
index 53ab713..a695bb2 100644
--- a/checks/debconf
+++ b/checks/debconf
@@ -68,6 +68,29 @@ my $seentemplates='';
 my $usespreinst='';
 my $usesmultiselect='';
 
+if ($type eq 'source') {
+    open(BINARY, '<', "fields/binary") or fail("Can't open fields/binary: $!");
+    my $binaries = <BINARY>;
+    close BINARY;
+    foreach my $binary (split /,\s+/, $binaries) {
+	chomp $binary;
+	my $templates_file = "debfiles/$binary.templates";
+	if (-f $templates_file) {
+	    my @templates = read_dpkg_control($templates_file, "templates file");
+
+	    foreach my $template (@templates) {
+		if (exists $template->{template} and exists $template->{_choices}) {
+		    tag "template-uses-unsplit-choices",
+			"$binary - $template->{template}";
+		}
+	    }
+	}
+    }
+
+    # The remainder of the checks are for binary packages, so we exit now
+    return 0;
+}
+
 if (open(PREINST, '<', "control/preinst")) {
     while (<PREINST>) {
 	s/#.*//;    # Not perfect for Perl, but should be OK
diff --git a/checks/debconf.desc b/checks/debconf.desc
index 6756107..219ef42 100644
--- a/checks/debconf.desc
+++ b/checks/debconf.desc
@@ -1,7 +1,7 @@
 Check-Script: debconf
 Author: Colin Watson <cjw44@flatline.org.uk>
 Abbrev: dc
-Type: binary, udeb
+Type: binary, udeb, source
 Unpack-Level: 2
 Info: This looks for common mistakes in packages using debconf.
 Needs-Info: scripts
@@ -290,3 +290,19 @@ Type: warning
 Info: Select templates with only yes and no choices should use the boolean
  type instead.
 Ref: debconf-devel(7)
+
+Tag: template-uses-unsplit-choices
+Type: warning
+Experimental: yes
+Info: The use of _Choices in templates is deprecated
+ An _Choices field must be translated as a single string.
+ .
+ Using __Choices allows each choice to be translated separately, easing
+ translation and is therefore recommended.
+ .
+ Instead of simply replacing all occurrences of "_Choices" by "__Choices",
+ apply the method described in po-debconf(7) under "SPLITTING CHOICES
+ LIST", to avoid breaking existing translations.
+ .
+ If in doubt, please ask for help on the debian-i18n mailing list.
+Ref: po-debconf(7)
diff --git a/debian/changelog b/debian/changelog
index fbfe548..b414292 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,9 @@ lintian (1.24.2) unstable; urgency=low
 
   * checks/changelog-file:
     + [ADB] Add missing "use Dep". Thanks gregor herrmann (Closes: #488397)
+  * checks/debconf{,.desc}:
+    + [ADB] Warn about the use of "_Choices" in templates file and suggest
+      using "__Choices" instead (Closes: #481152)
   * checks/description{,.desc}:
     + [RA] Warn about duplicated words in the description.  Patch from
       Raphael Geissert.  (Closes: #424746)

-- 
Debian package checker


Reply to: