From 7bf634e178506c2b055cc8facfbbaee5205c68a9 Mon Sep 17 00:00:00 2001 From: Raphael Hertzog Date: Thu, 5 Jun 2008 19:00:31 +0200 Subject: [PATCH] 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. --- ChangeLog | 10 ++++++++++ debian/changelog | 3 +++ scripts/Dpkg/Source/Package/V2.pm | 1 + scripts/Dpkg/Source/Patch.pm | 6 +++++- 4 files changed, 19 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 53d51a80..0ced3bfb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2008-06-05 Raphael Hertzog + + * 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 * scripts/Dpkg/Source/Package/V3/quilt.pm (get_patches): Really diff --git a/debian/changelog b/debian/changelog index cb00f3b4..c0b91d67 100644 --- a/debian/changelog +++ b/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 diff --git a/scripts/Dpkg/Source/Package/V2.pm b/scripts/Dpkg/Source/Package/V2.pm index f3907888..76c5bf95 100644 --- a/scripts/Dpkg/Source/Package/V2.pm +++ b/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'}; diff --git a/scripts/Dpkg/Source/Patch.pm b/scripts/Dpkg/Source/Patch.pm index 52c35e01..42484932 100644 --- a/scripts/Dpkg/Source/Patch.pm +++ b/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); -- 2.39.5