Bladeren bron

Merged in changes from 1.9.11 to 1.9.14 branch.

Adam Heath 25 jaren geleden
bovenliggende
commit
a28470b8b7
7 gewijzigde bestanden met toevoegingen van 144 en 20 verwijderingen
  1. 41 0
      ChangeLog
  2. 2 1
      THANKS
  3. 41 0
      debian/changelog
  4. 2 0
      scripts/controllib.pl
  5. 7 1
      scripts/dpkg-buildpackage.sh
  6. 13 0
      scripts/dpkg-source.1
  7. 38 18
      scripts/dpkg-source.pl

+ 41 - 0
ChangeLog

@@ -1,3 +1,44 @@
+Mon Jun 25 03:31:55 CDT 2001 Adam Heath <doogie@debian.org>
+
+  * Merged in changes from 1.9.11 to 1.9.14 branches.
+
+    + scripts/dpkg-source.pl: Disable source package sanity checking.
+    + scripts/dpkg-source.pl: make Uploaders optional.
+    + scripts/controllib.pl: Set the default to convert warnerrors
+      into warnings.
+    + scripts/dpkg-source.pl: Remove a warnable error if the orig.tar.gz
+      contains './'.
+    + scripts/dpkg-source.pl: Handle symlinks in the tarball, and don't
+      error out if found.
+    + scripts/dpkg-source.pl: Add support for an Uploaders field, which is
+      read from the first paragraph of debian/control, and propagated to
+      the .dsc.  This lists the people allowed to upload a package.  If it
+      is not set, then the value of the Maintainer is placed into this
+      field of the .dsc.  This bumps the .dsc format to 1.1.
+    + scripts/dpkg-source.pl: Handle stating of truncated cpio filenames
+      (100 char limit, bah)
+    + scripts/dpkg-source.pl: Set LC_ALL before calling external programs,
+      when we are going to parse their output.
+    + scripts/dpkg-source.pl: Move the check for '\n' and '././@LongLink'
+      before the check for leading './'.
+    + dselect/main.cc: Handle window resize in main menu
+    + scripts/dpkg-source.pl: Add a warnable error if the orig.tar.gz
+      contains './'.
+    + scripts/dpkg-source.pl: Handle the case where a single directory
+      exists in the orig.tar.gz, but it is NOT of the form <pkg>-<ver>.
+    + scripts/dpkg-source.pl: Don't error out if the files in the tar
+      have leading './'.
+    + scripts/dpkg-source.pl, scripts/controllib.pl, scripts/dpkg-source.1,
+      scripts/dpkg-buildpackage.sh: Add support for -W, which turns certain
+      errors into warnings, and -E, which turns them back into errors again.
+    + scripts/dpkg-source.pl: When the tarball doesn't contain directories,
+      only display the warning once for each directory.
+    + THANKS: Added Colin Watson.  Also put in an email address for Colin
+      Plumb.
+    + scripts/dpkg-source.pl: Grumble.  Fix case where top-dir in
+      orig.tar.gz was renamed to .orig.
+    + main/help.c: actually use narglist in do_script()
+
 Fri Jun 22 19:26:41 CEST 2001 Wichert Akkerman <wakkerma@debian.org>
 
   * dselect/main.cc: Handle window resize in main menu

+ 2 - 1
THANKS

@@ -8,7 +8,8 @@ Carl Streeter <streeter@cae.wisc.edu>
 Carlos Laviola <claviola@brfree.com.br>
 Charles Briscoe-Smith <cpbs@debian.org>
 Christophe Le Bars <clebars@teaser.fr>
-Colin Plumb
+Colin Plumb <colin@nyx.net>
+Colin Watson <cjw44@flatline.org.uk>
 Dan Gohman <gohmandj@mrs.umn.edu>
 Daniel Jacobowitz <dan@debian.org>
 Darren Stalder <torin@daft.com>

+ 41 - 0
debian/changelog

@@ -5,6 +5,47 @@ dpkg (1.10) unstable; urgency=low
 
  -- Wichert Akkerman <wakkerma@debian.org>  UNRELEASED
 
+dpkg (1.9.14) unstable; urgency=low
+
+  * Make the Uploaders field in a .dsc file optional.
+  * Disabled sanity checking of source packages.  
+ 
+ -- Adam Heath <doogie@debian.org>  Mon, 25 Jun 2001 02:22:40 -0500
+
+dpkg (1.9.13) unstable; urgency=medium
+
+  * Add a -W option to dpkg-source(and the other utils, where it is just
+    passed thru), to turn certain errors into warnings(of which, only
+    one is changed, namely, the 'tar doesn't contain preceeding directory'
+    error).  Closes: #101813, and partially 101845.
+  * Don't error out if the files in the tar have leading './', for
+    dpkg-source.  (another partial close of 101845).
+  * Handle the case where a single directory exists in the orig.tar.gz, but
+    it is NOT of the form <pkg>-<ver>.  Closes: #101845.
+  * Set LC_ALL in dpkg-source when we call external programs when we are
+    going to parse their output.  Another bug from 101845.
+  * Handle stating of truncated cpio filenames(100 char limit, bah), in
+    dpkg-source.  Another bug from 101845.
+  * Add support for an Uploaders field, which is read from the first
+    paragraph of debian/control, and propagated to the .dsc.  This lists
+    the people allowed to upload a package.  If it is not set, then the
+    value of the Maintainer is placed into this field of the .dsc.  This
+    bumps the .dsc format to 1.1.  Closes: #101815.
+  * Handle symlinks in the tarball, and don't error out if found.
+  * in controllib, make warnerrors default to warnings.  Affects
+    dpkg-source.  This will be changed to be errors in the future.
+
+ -- Adam Heath <doogie@debian.org>  Sun, 24 Jun 2001 13:48:52 -0500
+
+dpkg (1.9.12) unstable; urgency=medium
+
+  * Fix do_script() bug. Closes: Bug#101552
+  * Fix building and extracting of certain kinds of source packages.
+    Closes: #101684.
+  * Added Colin Watson to THANKS.
+
+ -- Adam Heath <doogie@debian.org>  Wed, 20 Jun 2001 18:27:03 -0500
+
 dpkg (1.9.11) unstable; urgency=low
 
   * The "Hang on to your hats, it gets bumpy from here." release.

+ 2 - 0
scripts/controllib.pl

@@ -23,6 +23,7 @@ $substvar{'Newline'}= "\n";
 $substvar{'Space'}= " ";
 $substvar{'Tab'}= "\t";
 $maxsubsts=50;
+$warnable_error= 1;
 
 $progname= $0; $progname= $& if $progname =~ m,[^/]+$,;
 
@@ -230,6 +231,7 @@ sub error { die "$progname: error: $_[0]\n"; }
 sub internerr { die "$progname: internal error: $_[0]\n"; }
 sub warn { warn "$progname: warning: $_[0]\n"; }
 sub usageerr { print(STDERR "$progname: @_\n\n"); &usageversion; exit(2); }
+sub warnerror { if ($warnable_error) { &warn( @_ ); } else { &error( @_ ); } }
 
 sub subprocerr {
     local ($p) = @_;

+ 7 - 1
scripts/dpkg-buildpackage.sh

@@ -39,6 +39,8 @@ Options: -r<gain-root-command>
          -tc           clean source tree when finished
          -ap           add pause before starting signature process
          -h            print this message
+         -W            Turn certain errors into warnings.      } passed to
+         -E            When -W is turned on, -E turned it off. } dpkg-source
          -i[<regex>]   ignore diffs of files matching regex } only passed
                                                              to dpkg-source
 END
@@ -66,6 +68,8 @@ maint=''
 desc=''
 noclean=false
 usepause=false
+warnable_error=0
+passopts=''
 
 while [ $# != 0 ]
 do
@@ -100,6 +104,8 @@ do
 	-m*)	maint="$value" ;;
 	-e*)	changedby="$value" ;;
 	-C*)	desc="$value" ;;
+	-W)	warnable_error=1; passopts="$passopts -W";;
+	-E)	warnable_error=0; passopts="$passopts -E";;	
 	*)	echo >&2 "$progname: unknown option or argument $1"
 		usageversion; exit 2 ;;
 	esac
@@ -186,7 +192,7 @@ if [ x$noclean != xtrue ]; then
 	withecho $rootcommand debian/rules clean
 fi
 if [ x$binaryonly = x ]; then
-	cd ..; withecho dpkg-source $diffignore -b "$dirn"; cd "$dirn"
+	cd ..; withecho dpkg-source $passopts $diffignore -b "$dirn"; cd "$dirn"
 fi
 if [ x$sourceonly = x ]; then
 	withecho debian/rules build 

+ 13 - 0
scripts/dpkg-source.1

@@ -236,6 +236,19 @@ the standard format described in the
 .IR "Debian packaging manual" .
 This option is understood by
 .BR dpkg-source ", " dpkg-gencontrol " and " dpkg-genchanges .
+.TP
+.BI -W
+This option turns certain errors into warnings.  Only dpkg-source uses
+this, but 
+.BR dpkg-buildpackage
+recognizes it, and passes it thru to
+.BR dpkg-source "."
+.TP
+.BI -E
+This option negates a previously set
+.BR -W "."
+It is currently only understood by
+.BR dpkg-buildpackage " and " dpkg-source "."
 .SH DPKG-SOURCE OPTIONS
 When the common options
 .BR -c " and " -l

+ 38 - 18
scripts/dpkg-source.pl

@@ -11,7 +11,7 @@ my $fn;
 $diff_ignore_default_regexp = '^.*~$|^\..*\.swp|DEADJOE|(?:/CVS|/RCS|/.deps)(?:$|/.*$)';
 
 $sourcestyle = 'X';
-$dscformat = "1.0";
+$dscformat = "1.1";
 
 use POSIX;
 use POSIX qw (:errno_h :signal_h);
@@ -40,6 +40,8 @@ Build options:   -c<controlfile>     get control info from this file
                  -T<varlistfile>     read variables here, not debian/substvars
                  -D<field>=<value>   override or add a .dsc field and value
                  -U<field>           remove a field
+                 -W                  Turn certain errors into warnings. 
+                 -E                  When -W is enabled, -E disables it.
                  -sa                 auto select orig source (-sA is default)
                  -i[<regexp>]        filter out files to ignore diffs of.
                                      Defaults to: '$diff_ignore_default_regexp'
@@ -89,6 +91,10 @@ while (@ARGV && $ARGV[0] =~ m/^-/) {
         $varlistfile= $';
     } elsif (m/^-h$/) {
         &usageversion; exit(0);
+    } elsif (m/^-W$/) {
+        $warnable_error= 1;
+    } elsif (m/^-E$/) {
+        $warnable_error= 0;
     } elsif (m/^--$/) {
         last;
     } else {
@@ -126,7 +132,7 @@ if ($opmode eq 'build') {
         if (s/^C //) {
 #print STDERR "G key >$_< value >$v<\n";
             if (m/^Source$/) { &setsourcepackage; }
-            elsif (m/^(Standards-Version|Origin|Maintainer)$/) { $f{$_}= $v; }
+            elsif (m/^(Standards-Version|Origin|Maintainer|Uploaders)$/) { $f{$_}= $v; }
 	    elsif (m/^Build-(Depends|Conflicts)(-Indep)?$/i) { $f{$_}= $v; }
             elsif (s/^X[BC]*S[BC]*-//i) { $f{$_}= $v; }
             elsif (m/^(Section|Priority|Files|Bugs)$/ || m/^X[BC]+-/i) { }
@@ -323,7 +329,7 @@ if ($opmode eq 'build') {
         }
 
         $expectprefix= $origdir; $expectprefix =~ s,^\./,,;
-        checktarsane($origtargz,$expectprefix);
+#        checktarsane($origtargz,$expectprefix);
         mkdir("$origtargz.tmp-nest",0755) ||
             &syserr("unable to create \`$origtargz.tmp-nest'");
         extracttar($origtargz,"$origtargz.tmp-nest",$expectprefix);
@@ -375,8 +381,8 @@ if ($opmode eq 'build') {
                 }
                 defined($c3= open(DIFFGEN,"-|")) || &syserr("fork for diff");
                 if (!$c3) {
-		    $ENV{'LANG'}= 'C';
 		    $ENV{'LC_ALL'}= 'C';
+		    $ENV{'LANG'}= 'C';
                     exec('diff','-u',
                          '-L',"$basedirname.orig/$fn",
                          '-L',"$basedirname/$fn",
@@ -530,7 +536,7 @@ if ($opmode eq 'build') {
     checkstats($tarfile);
     checkstats($difffile) if length($difffile);
 
-    checktarsane("$dscdir/$tarfile",$expectprefix);
+#    checktarsane("$dscdir/$tarfile",$expectprefix);
 
     if (length($difffile)) {
             
@@ -657,6 +663,7 @@ if ($opmode eq 'build') {
         if (!$c2) {
             open(STDIN,"<&GZIP") || &syserr("reopen gzip for patch");
             chdir($newdirectory) || &syserr("chdir to $newdirectory for patch");
+	    $ENV{'LC_ALL'}= 'C';
 	    $ENV{'LANG'}= 'C';
             exec('patch','-s','-t','-F','0','-N','-p1','-u',
                  '-V','never','-g0','-b','-z','.dpkg-orig');
@@ -689,8 +696,7 @@ if ($opmode eq 'build') {
     $plainmode= $execmode & ~0111;
     $fifomode= ($plainmode & 0222) | (($plainmode & 0222) << 1);
     for $fn (@filesinarchive) {
-        $fn= substr($fn,length($expectprefix)+1);
-        $fn= "$newdirectory/$fn";
+	$fn=~ s,^$expectprefix,$newdirectory,;
         (@s= lstat($fn)) || &syserr("cannot stat extracted object \`$fn'");
         $mode= $s[2];
         if (-d _) {
@@ -753,7 +759,8 @@ sub checktarcpio {
     &forkgzipread ("$tarfileread");
     if (! defined ($c2 = open (CPIO,"-|"))) { &syserr ("fork for cpio"); }
     if (!$c2) {
-	$ENV{'LANG'} = 'C';
+	$ENV{'LC_ALL'}= 'C';
+	$ENV{'LANG'}= 'C';
         open (STDIN,"<&GZIP") || &syserr ("reopen gzip for cpio");
         &cpiostderr;
         exec ('cpio','-0t');
@@ -770,13 +777,20 @@ sub checktarcpio {
 	my $pname = $fn;
 	$pname =~ y/ -~/?/c;
 
+        if ($fn =~ m/\n/) {
+	    &error ("tarfile \`$tarfileread' contains object with".
+		    " newline in its name ($pname)");
+	}
+
+	next if ($fn eq '././@LongLink');
+
 	if (! $tarprefix) {
 	    if ($fn =~ m/\n/) {
                 &error("first output from cpio -0t (from \`$tarfileread') ".
                        "contains newline - you probably have an out of ".
                        "date version of cpio.  GNU cpio 2.4.2-2 is known to work");
 	    }
-	    $tarprefix = ($fn =~ m,([^/]*)[/],)[0];
+	    $tarprefix = ($fn =~ m,((\./)*[^/]*)[/],)[0];
 	    # need to check for multiple dots on some operating systems
 	    # empty tarprefix (due to regex failer) will match emptry string
 	    if ($tarprefix =~ /^[.]*$/) {
@@ -785,13 +799,6 @@ sub checktarcpio {
 	    }
 	}
 
-        if ($fn =~ m/\n/) {
-	    &error ("tarfile \`$tarfileread' contains object with".
-		    " newline in its name ($pname)");
-	}
-
-	next if ($fn eq '././@LongLink');
-
 	my $fprefix = substr ($fn, 0, length ($tarprefix));
         my $slash = substr ($fn, length ($tarprefix), 1);
         if ((($slash ne '/') && ($slash ne '')) || ($fprefix ne $tarprefix)) {
@@ -812,7 +819,6 @@ sub checktarcpio {
     $/= "\n";
 
     my $tarsubst = quotemeta ($tarprefix);
-    @filesinarchive = map { s/^$tarsubst/$wpfx/; $_ } @filesinarchive;
 
     return $tarprefix;
 }
@@ -831,6 +837,7 @@ sub checktarsane {
     &forkgzipread ("$tarfileread");
     if (! defined ($c2 = open (TAR,"-|"))) { &syserr ("fork for tar -t"); }
     if (! $c2) {
+	$ENV{'LC_ALL'}= 'C';
         $ENV{'LANG'}= 'C';
         open (STDIN, "<&GZIP") || &syserr ("reopen gzip for tar -t");
         exec ('tar', '-vvtf', '-'); &syserr ("exec tar -vvtf -");
@@ -870,6 +877,12 @@ sub checktarsane {
 	# fetch name of file as given by cpio
         $fn = $filesinarchive[$efix++];
 
+	my $l = length($fn);
+	if (substr ($tarfn, 0, $l + 4) eq "$fn -> ") {
+		# This is a symlink, as listed by tar.  cpio doesn't
+		# give us the targets of the symlinks, so we ignore this.
+		$tarfn = substr($tarfn, 0, $l);
+	}
 	if ($tarfn ne $fn) {
 	    if ((length ($fn) == 99) && (length ($tarfn) >= 99)
 		&& (substr ($fn, 0, 99) eq substr ($tarfn, 0, 99))) {
@@ -877,6 +890,10 @@ sub checktarsane {
 		# to the first 100 characters.  let it slide for now.
 		&warn ("filename \`$pname' was truncated by cpio;" .
 		       " unable to check full pathname");
+		# Since it didn't match, later checks will not be able
+		# to stat this file, so we replace it with the filename
+		# fetched from tar.
+		$filesinarchive[$efix-1] = $tarfn;
 	    } else {
 		&error ("tarfile \`$tarfileread' contains unexpected object".
 			" listed by tar as \`$_'; expected \`$pname'");
@@ -906,11 +923,13 @@ sub checktarsane {
 	}
 
         if ($type eq 'd') { $tarfn =~ s,/$,,; }
+        $tarfn =~ s,(\./)*,,;
         my $dirname = $tarfn;
 
         if (($dirname =~ s,/[^/]+$,,) && (! defined ($dirincluded{$dirname}))) {
-            &error ("tarfile \`$tarfileread' contains object \`$pname' but its containing ".
+            &warnerror ("tarfile \`$tarfileread' contains object \`$pname' but its containing ".
 		    "directory \`$dirname' does not precede it");
+	    $dirincluded{$dirname} = 1;
 	}
 	if ($type eq 'd') { $dirincluded{$tarfn} = 1; }
         if ($type ne '-') { $notfileobject{$tarfn} = 1; }
@@ -920,6 +939,7 @@ sub checktarsane {
     &reapgzip;
 
     my $tarsubst = quotemeta ($tarprefix);
+    @filesinarchive = map { s/^$tarsubst/$wpfx/; $_ } @filesinarchive;
     %dirincluded = map { s/^$tarsubst/$wpfx/; $_=>1 } (keys %dirincluded);
     %notfileobject = map { s/^$tarsubst/$wpfx/; $_=>1 } (keys %notfileobject);
 }