Просмотр исходного кода

dpkg-source: Fix diff generation for filenames containing spaces

Include a trailing HT character in the diff labels if
the filename contains spaces. Apparantly this is
standard but undocumented diff behaviour. Based on
a patch by Marcel Toele.
Frank Lichtenheld лет назад: 19
Родитель
Сommit
2c22031a81
3 измененных файлов с 16 добавлено и 4 удалено
  1. 8 0
      ChangeLog
  2. 3 0
      debian/changelog
  3. 5 4
      scripts/dpkg-source.pl

+ 8 - 0
ChangeLog

@@ -1,3 +1,11 @@
+2007-10-07  Frank Lichtenheld  <djpig@debian.org>
+	    Marcel Toele  <mtoele@kern.nl>
+
+	* scripts/dpkg-source.pl (handleformat): Include
+	a trailing HT character in the diff labels if
+	the filename contains spaces. Apparantly this is
+	standard but undocumented diff behaviour.
+
 2007-09-29  Frank Lichtenheld  <djpig@debian.org>
 
 	* scripts/dpkg-buildpackage.pl: Call checkversion()

+ 3 - 0
debian/changelog

@@ -35,6 +35,9 @@ dpkg (1.14.7) UNRELEASED; urgency=low
     Closes: #379418
   * Let dpkg-buildpackage error out early if the version number from
     the changelog is not a valid Debian version. Closes: #216075
+  * Fix dpkg-source to create correct diffs for files with spaces in
+    their name (apparantly we don't have many of those ;).
+    Based on a patch by Marcel Toele. Closes: #445380
 
   [ Updated dpkg translations ]
   * Basque (Piarres Beobide). Closes: #440859

+ 5 - 4
scripts/dpkg-source.pl

@@ -594,10 +594,11 @@ if ($opmode eq 'build') {
 		    $ENV{'LC_ALL'}= 'C';
 		    $ENV{'LANG'}= 'C';
 		    $ENV{'TZ'}= 'UTC0';
-                    exec('diff','-u',
-                         '-L',"$basedirname.orig/$fn",
-                         '-L',"$basedirname/$fn",
-                         '--',"$ofnread","$dir/$fn") or &syserr(_g("exec diff"));
+		    my $tab = ("$basedirname/$fn" =~ / /) ? "\t" : '';
+		    exec('diff','-u',
+			 '-L',"$basedirname.orig/$fn$tab",
+			 '-L',"$basedirname/$fn$tab",
+			 '--',"$ofnread","$dir/$fn") or &syserr(_g("exec diff"));
                 }
 		my $difflinefound = 0;
                 $/= "\n";