]> mj.ucw.cz Git - eval.git/commitdiff
Maint: Release machinery updated from the most recent pciutils
authorMartin Mares <mj@ucw.cz>
Mon, 24 Sep 2012 13:05:18 +0000 (15:05 +0200)
committerMartin Mares <mj@ucw.cz>
Mon, 24 Sep 2012 13:05:18 +0000 (15:05 +0200)
maint/release.pm

index b0fa46ee1ec5676f8a46fd79bd476b98de930838..85a074e6be35f0d3ecced472329f6b89a69f3127 100644 (file)
@@ -1,6 +1,6 @@
 #!/usr/bin/perl
 # A simple system for making software releases
-# (c) 2003--2006 Martin Mares <mj@ucw.cz>
+# (c) 2003--2011 Martin Mares <mj@ucw.cz>
 
 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=<version>] [--noupload]";
+               "upload!" => \$s->{"do_upload"},
+               "sign!" => \$s->{"do_sign"},
+       ) || die "Syntax: release [--verbose] [--test] [--nopatch] [--diff-against=<version>] [--noupload] [--nosign]";
 }
 
 sub Test($) {