From 56609ced2ddded466c4e3120231ea585b20afb3e Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Sun, 2 Oct 2011 13:30:49 +0200 Subject: [PATCH] Release scripts: sign the tarball using GPG --- maint/release.pm | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/maint/release.pm b/maint/release.pm index b0fa46e..85a074e 100644 --- a/maint/release.pm +++ b/maint/release.pm @@ -1,6 +1,6 @@ #!/usr/bin/perl # A simple system for making software releases -# (c) 2003--2006 Martin Mares +# (c) 2003--2011 Martin Mares package UCW::Release; use strict; @@ -34,7 +34,8 @@ sub new($$) { "do_test" => 1, "do_patch" => 1, "diff_against" => "", - "do_upload" => 1 + "do_upload" => 1, + "do_sign" => 1, }; bless $s; return $s; @@ -198,6 +199,14 @@ sub GenPackage($) { `cd $dd && tar cz${tarvv}f $pkg.tar.gz $pkg >&2`; die if $?; push @{$s->{"distfiles"}}, "$dd/$pkg.tar.gz"; + if ($s->{'do_sign'}) { + print "Signing package\n"; + system "gpg", "--armor", "--detach-sig", "$dd/$pkg.tar.gz"; + die if $?; + rename "$dd/$pkg.tar.gz.asc", "$dd/$pkg.tar.gz.sign" or die "No signature produced!?\n"; + push @{$s->{"distfiles"}}, "$dd/$pkg.tar.gz.sign"; + } + my $adir = $s->{"archivedir"}; my $afile = "$adir/$pkg.tar.gz"; print "Archiving to $afile\n"; @@ -223,8 +232,9 @@ sub ParseOptions($) { "test!" => \$s->{"do_test"}, "patch!" => \$s->{"do_patch"}, "diff-against=s" => \$s->{"diff_against"}, - "upload!" => \$s->{"do_upload"} - ) || die "Syntax: release [--verbose] [--test] [--nopatch] [--diff-against=] [--noupload]"; + "upload!" => \$s->{"do_upload"}, + "sign!" => \$s->{"do_sign"}, + ) || die "Syntax: release [--verbose] [--test] [--nopatch] [--diff-against=] [--noupload] [--nosign]"; } sub Test($) { -- 2.39.2