Explorar el Código

dpkg-source warns now about new empty files since those will
not be represented in the diff. Closes: #383394

Frank Lichtenheld hace 19 años
padre
commit
54bb0defc1
Se han modificado 3 ficheros con 18 adiciones y 6 borrados
  1. 5 0
      ChangeLog
  2. 2 0
      debian/changelog
  3. 11 6
      scripts/dpkg-source.pl

+ 5 - 0
ChangeLog

@@ -1,3 +1,8 @@
+2007-07-01  Frank Lichtenheld  <djpig@debian.org>
+
+	* scripts/dpkg-source.pl: Warn that newly created empty files are
+	not currently represented in the diff.
+
 2007-07-01  Ian Jackson  <ian@davenant.greenend.org.uk>
 2007-07-01  Ian Jackson  <ian@davenant.greenend.org.uk>
 
 
 	* scripts/dpkg-source.pl: Don't remove setgid bits
 	* scripts/dpkg-source.pl: Don't remove setgid bits

+ 2 - 0
debian/changelog

@@ -29,6 +29,8 @@ dpkg (1.14.5) UNRELEASED; urgency=low
     tar balls to match more the user's preferences instead of
     tar balls to match more the user's preferences instead of
     ours or the ones from the originator of the tar ball. Patch
     ours or the ones from the originator of the tar ball. Patch
     by Ian Jackson. Closes: #390915, #207289
     by Ian Jackson. Closes: #390915, #207289
+  * dpkg-source warns now about new empty files since those will
+    not be represented in the diff. Closes: #383394
   
   
   [ Updated dselect translations ]
   [ Updated dselect translations ]
   * French (Christian Perrier)
   * French (Christian Perrier)

+ 11 - 6
scripts/dpkg-source.pl

@@ -510,6 +510,7 @@ if ($opmode eq 'build') {
             $fn =~ s,^\./,,;
             $fn =~ s,^\./,,;
             lstat("$dir/$fn") || &syserr(sprintf(_g("cannot stat file %s"), "$dir/$fn"));
             lstat("$dir/$fn") || &syserr(sprintf(_g("cannot stat file %s"), "$dir/$fn"));
 	    my $mode = S_IMODE((lstat(_))[2]);
 	    my $mode = S_IMODE((lstat(_))[2]);
+	    my $size = (lstat(_))[7];
             if (-l _) {
             if (-l _) {
                 $type{$fn}= 'symlink';
                 $type{$fn}= 'symlink';
 		checktype($origdir, $fn, '-l') || next;
 		checktype($origdir, $fn, '-l') || next;
@@ -526,12 +527,16 @@ if ($opmode eq 'build') {
                 if (!lstat("$origdir/$fn")) {
                 if (!lstat("$origdir/$fn")) {
                     $! == ENOENT || &syserr(sprintf(_g("cannot stat orig file %s"), "$origdir/$fn"));
                     $! == ENOENT || &syserr(sprintf(_g("cannot stat orig file %s"), "$origdir/$fn"));
                     $ofnread= '/dev/null';
                     $ofnread= '/dev/null';
-		    if( $mode & ( S_IXUSR | S_IXGRP | S_IXOTH ) ) {
-			warning(sprintf(_g("executable mode %04o of '%s' will not be represented in diff"), $mode, $fn))
-			    unless $fn eq 'debian/rules';
-		    }
-		    if( $mode & ( S_ISUID | S_ISGID | S_ISVTX ) ) {
-			warning(sprintf(_g("special mode %04o of '%s' will not be represented in diff"), $mode, $fn));
+		    if( !$size ) {
+			warning(sprintf(_g("newly created empty file '%s' will not be represented in diff"), $fn));
+		    } else {
+			if( $mode & ( S_IXUSR | S_IXGRP | S_IXOTH ) ) {
+			    warning(sprintf(_g("executable mode %04o of '%s' will not be represented in diff"), $mode, $fn))
+				unless $fn eq 'debian/rules';
+			}
+			if( $mode & ( S_ISUID | S_ISGID | S_ISVTX ) ) {
+			    warning(sprintf(_g("special mode %04o of '%s' will not be represented in diff"), $mode, $fn));
+			}
 		    }
 		    }
                 } elsif (-f _) {
                 } elsif (-f _) {
                     $ofnread= "$origdir/$fn";
                     $ofnread= "$origdir/$fn";