diff options
author | Guillem Jover <guillem@debian.org> | 2019-05-01 23:18:34 +0200 |
---|---|---|
committer | Guillem Jover <guillem@debian.org> | 2019-10-12 16:37:22 +0200 |
commit | 522e3b46ee9861f6e1b87124066d716a5b6a6c0c (patch) | |
tree | 861134f3a6a4f4ade5d742bb740815116b57d535 | |
parent | 9229100918a1741ceb4b0f60636869cfc9432731 (diff) | |
download | dpkg-522e3b46ee9861f6e1b87124066d716a5b6a6c0c.tar.gz |
Dpkg::Source::Package: Refactor original tarball handling
-rw-r--r-- | debian/changelog | 2 | ||||
-rw-r--r-- | scripts/Dpkg/Source/Package/V1.pm | 8 | ||||
-rw-r--r-- | scripts/Dpkg/Source/Package/V2.pm | 32 |
3 files changed, 21 insertions, 21 deletions
diff --git a/debian/changelog b/debian/changelog index bb386ab0b..bcec8748f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -18,6 +18,8 @@ dpkg (1.20.0) UNRELEASED; urgency=medium * perl: Remove support for versioned GnuPG 2 program and packages. * Documentation: - man: Fix uncommon wording constructs. + * Code internals: + - Dpkg::Source::Package: Refactor original tarball handling. * Build system: - Bump minimal Perl version to 5.24.1. diff --git a/scripts/Dpkg/Source/Package/V1.pm b/scripts/Dpkg/Source/Package/V1.pm index be13750a4..ff683af21 100644 --- a/scripts/Dpkg/Source/Package/V1.pm +++ b/scripts/Dpkg/Source/Package/V1.pm @@ -409,9 +409,11 @@ sub do_build { $sourcepackage, $tarname); } - $self->add_file($tarname) if $tarname; - if ($tarname and -e "$tarname.sig" and not -e "$tarname.asc") { - openpgp_sig_to_asc("$tarname.sig", "$tarname.asc"); + if ($tarname) { + $self->add_file($tarname); + if (-e "$tarname.sig" and not -e "$tarname.asc") { + openpgp_sig_to_asc("$tarname.sig", "$tarname.asc"); + } } if ($tarsign and -e $tarsign) { info(g_('building %s using existing %s'), $sourcepackage, $tarsign); diff --git a/scripts/Dpkg/Source/Package/V2.pm b/scripts/Dpkg/Source/Package/V2.pm index e2c1b49fb..db9bd3e71 100644 --- a/scripts/Dpkg/Source/Package/V2.pm +++ b/scripts/Dpkg/Source/Package/V2.pm @@ -408,26 +408,22 @@ sub _generate_patch { 'one is allowed'), $tarfile, $file); } $tarfile = $file; - push @origtarfiles, $file; - $self->add_file($file); - if (-e "$file.sig" and not -e "$file.asc") { - openpgp_sig_to_asc("$file.sig", "$file.asc"); - } - if (-e "$file.asc") { - push @origtarfiles, "$file.asc"; - $self->add_file("$file.asc") - } } elsif ($file =~ /\.orig-([[:alnum:]-]+)\.tar\.$comp_ext_regex$/) { $addonfile{$1} = $file; - push @origtarfiles, $file; - $self->add_file($file); - if (-e "$file.sig" and not -e "$file.asc") { - openpgp_sig_to_asc("$file.sig", "$file.asc"); - } - if (-e "$file.asc") { - push @origtarfiles, "$file.asc"; - $self->add_file("$file.asc"); - } + } else { + next; + } + + push @origtarfiles, $file; + $self->add_file($file); + + # Check for an upstream signature. + if (-e "$file.sig" and not -e "$file.asc") { + openpgp_sig_to_asc("$file.sig", "$file.asc"); + } + if (-e "$file.asc") { + push @origtarfiles, "$file.asc"; + $self->add_file("$file.asc") } } |