]> git.donarmstrong.com Git - debhelper.git/blobdiff - Debian/Debhelper/Dh_Lib.pm
r495: * dh_undocumented: check for existing uncompressed man pages. Closes: #87972
[debhelper.git] / Debian / Debhelper / Dh_Lib.pm
index 4beaa0dc4f90b65875a8a5384c6a71614f46e349..fd3c12ecf7e25af2bc2d23fe01bcc86e229e1c8c 100644 (file)
@@ -412,6 +412,7 @@ sub GetPackages {
        my $package="";
        my $arch="";
        my @list=();
+       my %seen;
        open (CONTROL, 'debian/control') ||
                error("cannot read debian/control: $!\n");
        while (<CONTROL>) {
@@ -419,10 +420,18 @@ sub GetPackages {
                s/\s+$//;
                if (/^Package:\s*(.*)/) {
                        $package=$1;
+                       # Detect duplicate package names in the same control file.
+                       if (! $seen{$package}) {
+                               $seen{$package}=1;
+                       }
+                       else {
+                               error("debian/control has a duplicate entry for $package");
+                       }
                }
                if (/^Architecture:\s*(.*)/) {
                        $arch=$1;
                }
+               
                if (!$_ or eof) { # end of stanza.
                        if ($package &&
                            (($type eq 'indep' && $arch eq 'all') ||