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

dpkg-source/3.0 (quilt): allow /dev/null in automatic patch

* scripts/Dpkg/Source/Patch.pm (add_diff_directory): If option
use_dev_null is set, then the label of the "old" file will be
'/dev/null' if we're creating a new file (instead of using the
name of the created file, like it's currently done in .diff
of version "1.0" source packages).
* scripts/Dpkg/Source/Package/V2.pm (prepare_build): Use the new
option "use_dev_null" when creating the automatic patch.
Raphael Hertzog лет назад: 18
Родитель
Сommit
7bf634e178
4 измененных файлов с 19 добавлено и 1 удалено
  1. 10 0
      ChangeLog
  2. 3 0
      debian/changelog
  3. 1 0
      scripts/Dpkg/Source/Package/V2.pm
  4. 5 1
      scripts/Dpkg/Source/Patch.pm

+ 10 - 0
ChangeLog

@@ -1,3 +1,13 @@
+2008-06-05  Raphael Hertzog  <hertzog@debian.org>
+
+	* scripts/Dpkg/Source/Patch.pm (add_diff_directory): If option
+	use_dev_null is set, then the label of the "old" file will be
+	'/dev/null' if we're creating a new file (instead of using the
+	name of the created file, like it's currently done in .diff
+	of version "1.0" source packages).
+	* scripts/Dpkg/Source/Package/V2.pm (prepare_build): Use the new
+	option "use_dev_null" when creating the automatic patch.
+
 2008-06-05  Raphael Hertzog  <hertzog@debian.org>
 
 	* scripts/Dpkg/Source/Package/V3/quilt.pm (get_patches): Really

+ 3 - 0
debian/changelog

@@ -15,6 +15,9 @@ dpkg (1.14.20) UNRELEASED; urgency=low
     itself.
   * Correctly skip comments in quilt series files (concerns "3.0 (quilt)" source
     packages).
+  * The automatically created patches (in source package formats "2.0" and
+    "3.0 (quilt)") will now contain "/dev/null" as previous filename when the
+    patch creates a new file (instead of putting the same name).
 
   [ Helge Kreutzmann ]
   * Fix a typo in dselect.1

+ 1 - 0
scripts/Dpkg/Source/Package/V2.pm

@@ -204,6 +204,7 @@ sub prepare_build {
         diff_ignore_regexp => $self->{'options'}{'diff_ignore_regexp'},
         include_removal => $self->{'options'}{'include_removal'},
         include_timestamp => $self->{'options'}{'include_timestamp'},
+        use_dev_null => 1,
     };
     push @{$self->{'options'}{'tar_ignore'}}, "debian/patches/.dpkg-source-applied";
     $self->check_patches_applied($dir) if $self->{'options'}{'preparation'};

+ 5 - 1
scripts/Dpkg/Source/Patch.pm

@@ -175,8 +175,12 @@ sub add_diff_directory {
                 return;
             }
 
+            my $label_old = "$basedir.orig/$fn";
+            if ($opts{'use_dev_null'}) {
+                $label_old = $old_file if $old_file eq '/dev/null';
+            }
             my $success = $self->add_diff_file($old_file, "$new/$fn",
-                label_old => "$basedir.orig/$fn",
+                label_old => $label_old,
                 label_new => "$basedir/$fn",
                 %opts);