[devscripts] 01/01: mk-origtargz: skip upstream signature when repacking

Osamu Aoki osamu at moszumanska.debian.org
Sat Sep 9 00:11:36 UTC 2017


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

osamu pushed a commit to branch master
in repository devscripts.

commit 66ff1816fdce7bdd46a7d770d83fdb53599f9de8
Author: Osamu Aoki <osamu at debian.org>
Date:   Sat Sep 9 08:44:20 2017 +0900

    mk-origtargz: skip upstream signature when repacking
    
    Bug#874667
    
    Signed-off-by: Osamu Aoki <osamu at debian.org>
---
 debian/changelog        |  1 +
 scripts/mk-origtargz.pl | 27 ++++++++++++++++++++++-----
 2 files changed, 23 insertions(+), 5 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index cf1a035..b4d7719 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -66,6 +66,7 @@ devscripts (2.17.10) UNRELEASED; urgency=medium
   * mk-origtargz
     + Rename and convert the detached signature. Closes: #832267, #837173,
       #870281
+    + Skip upstream signature when repacking.  Closes: #874667
   * uupdate 
     + -b option is not "New upstream release". Closes: #842468, #845610
   * Made source package bootstrappable. Closes: #870640
diff --git a/scripts/mk-origtargz.pl b/scripts/mk-origtargz.pl
index e35b142..4299b93 100644
--- a/scripts/mk-origtargz.pl
+++ b/scripts/mk-origtargz.pl
@@ -249,6 +249,12 @@ my $suffix = '';
 
 my $upstream = undef;
 
+# $signature values
+# 0: No upstream signature file
+# 1: Upstream signature file on compressed tar.gz
+# 2: Upstream signature file on uncompressed tar
+# 3: Upstream signature as non-detached
+# 4: Repacked
 my $signature = 0;
 my $signature_file = "";
 
@@ -427,6 +433,9 @@ my $zipfile_deleted = 0;
 
 # If the file is a zipfile, we need to create a tarfile from it.
 if ($is_zipfile) {
+    if ($signature) {
+	$signature = 4; # repack upstream file
+    }
     if ($is_xpifile) {
 	system('command -v xpi-unpack >/dev/null 2>&1') >> 8 == 0
 	    or die("xpi-unpack binary not found. You need to install the package mozilla-devscripts to be able to repack .xpi upstream archives.\n");
@@ -554,6 +563,9 @@ if ($deletecount) {
 
 # Actually do the unpack, remove, pack cycle
 if ($do_repack || $deletecount) {
+    if ($signature) {
+	$signature = 4; # repack upstream file
+    }
     decompress_archive($upstream_tar, $destfiletar);
     unlink $upstream_tar if $mode eq "rename";
     # We have to use piping because --delete is broken otherwise, as documented
@@ -598,15 +610,16 @@ if ($signature == 1) {
     $destsigfile = sprintf "%s.asc", $destfile;
 } elsif ($signature == 2) {
     $destsigfile = sprintf "%s.asc", $destfiletar;
-} else {
+} elsif ($signature == 3) {
     # XXX FIXME XXX place holder
     $destsigfile = sprintf "%s.asc", $destfile;
+} else {
+    # $signature == 0 or 4
+    $destsigfile = "";
 }
 
-if ($signature != 0) {
-    if ($mode eq "repack") {
-	print "Skip adding upstream signature since tarball is repacked.\n";
-    } elsif ($is_gpgfile) {
+if ($signature == 1 or $signature == 2) {
+   if ($is_gpgfile) {
 	my $enarmor = `gpg --output - --enarmor $signature_file 2>&1`;
 	$? == 0 or die "mk-origtargz: Failed to convert $signature_file to *.asc\n";
 	$enarmor =~ s/ARMORED FILE/SIGNATURE/;
@@ -627,6 +640,10 @@ if ($signature != 0) {
 	    }
 	}
     }
+} elsif ($signature == 3) {
+    print "Skip adding upstream signature since upstream file has non-detached signature file.\n";
+} elsif ($signature == 4) {
+    print "Skip adding upstream signature since upstream file is repacked.\n";
 }
 
 # Final check: Is the tarball usable

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/collab-maint/devscripts.git



More information about the devscripts-devel mailing list