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

[SCM] Debian package checker branch, master, updated. a8d2233cbc940d0311a68aaf9d49ae0976003906



The following commit has been merged in the master branch:
commit a8d2233cbc940d0311a68aaf9d49ae0976003906
Author: Adam D. Barratt <adam@adam-barratt.org.uk>
Date:   Sat Jul 5 14:39:39 2008 +0100

    Fix template-uses-unsplit-choices for single binary packages
    
    Add debfiles/templates to the list of files to check against, so that we also
    spot the problem in a single-binary source package

diff --git a/checks/debconf b/checks/debconf
index a695bb2..5c0770b 100644
--- a/checks/debconf
+++ b/checks/debconf
@@ -72,9 +72,23 @@ if ($type eq 'source') {
     open(BINARY, '<', "fields/binary") or fail("Can't open fields/binary: $!");
     my $binaries = <BINARY>;
     close BINARY;
+    my @files;
     foreach my $binary (split /,\s+/, $binaries) {
 	chomp $binary;
-	my $templates_file = "debfiles/$binary.templates";
+	push @files, "$binary.templates";
+    }
+    push @files, "templates";
+
+    foreach my $file (@files) {
+	my $templates_file = "debfiles/$file";
+	my $binary = $file;
+	$binary =~ s/\.?templates$//;
+	# Single binary package (so @files contains "templates" and
+	# "binary.templates")?
+	if (!$binary and $#files > 1) {
+	    $binary = $binaries;
+	}
+
 	if (-f $templates_file) {
 	    my @templates = read_dpkg_control($templates_file, "templates file");
 

-- 
Debian package checker


Reply to: