[Reproducible-commits] [dpkg] 06/08: dpkg-source: do not try to apply empty patch set

Holger Levsen holger at layer-acht.org
Tue May 3 08:43:00 UTC 2016


This is an automated email from the git hooks/post-receive script.

holger pushed a commit to annotated tag 1.14.27
in repository dpkg.

commit ca671fa2e0de77a9af573e0be4a840d245ccb338
Author: Raphael Hertzog <hertzog at debian.org>
Date:   Sun May 10 19:18:05 2009 +0200

    dpkg-source: do not try to apply empty patch set
    
    In format 2.0 and 3.0 (quilt), do not try to apply the patches if
    there are none.
---
 scripts/Dpkg/Source/Package/V2.pm       | 2 ++
 scripts/Dpkg/Source/Package/V3/quilt.pm | 3 ++-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/scripts/Dpkg/Source/Package/V2.pm b/scripts/Dpkg/Source/Package/V2.pm
index e9bdfc0..a162f53 100644
--- a/scripts/Dpkg/Source/Package/V2.pm
+++ b/scripts/Dpkg/Source/Package/V2.pm
@@ -175,6 +175,8 @@ sub get_patches {
 
 sub apply_patches {
     my ($self, $dir, $skip_auto) = @_;
+    my @patches = $self->get_patches($dir, $skip_auto);
+    return unless scalar(@patches);
     my $timestamp = time();
     my $applied = File::Spec->catfile($dir, "debian", "patches", ".dpkg-source-applied");
     open(APPLIED, '>', $applied) || syserr(_g("cannot write %s"), $applied);
diff --git a/scripts/Dpkg/Source/Package/V3/quilt.pm b/scripts/Dpkg/Source/Package/V3/quilt.pm
index 93ce747..e6645c9 100644
--- a/scripts/Dpkg/Source/Package/V3/quilt.pm
+++ b/scripts/Dpkg/Source/Package/V3/quilt.pm
@@ -137,6 +137,8 @@ sub apply_patches {
                 syserr(_g("can't create symlink %s"), $dest);
         }
     }
+    my @patches = $self->get_patches($dir, $skip_auto);
+    return unless scalar(@patches);
 
     # Apply patches
     my $applied = File::Spec->catfile($dir, "debian", "patches", ".dpkg-source-applied");
@@ -144,7 +146,6 @@ sub apply_patches {
     my $now = time();
     my $pobj = {};
     my $panalysis = {};
-    my @patches = $self->get_patches($dir, $skip_auto);
     foreach my $patch (@patches) {
         my $path = File::Spec->catfile($dir, "debian", "patches", $patch);
         $pobj->{$patch} = Dpkg::Source::Patch->new(filename => $path);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/dpkg.git



More information about the Reproducible-commits mailing list