Debian Codegraph @

maint/release

raw
1 #!/usr/bin/perl
2 # A simple script for making releases of the pciutils
3 # (c) 2003--2012 Martin Mares <[email protected]>
4
5 use strict;
6 use warnings;
7 require "./maint/release.pm";
8
9 # Check API version
10 my $apiver = "???";
11 open X, "lib/pci.h" or die;
12 while (<X>) {
13 /^#define PCI_LIB_VERSION 0x(.{6})$/ and $apiver = $1;
14 }
15 print "API version is $apiver ... <confirm> "; <STDIN>;
16
17 #print "Updating public GIT tree\n";
18 #`git push --tags public`; die if $?;
19
20 my $r = new UCW::Release("pciutils");
21 my $ver = $r->GetVersionFromFile("Makefile", "VERSION=(.*)");
22 $r->GetVersionsFromChangelog("ChangeLog", "Released as (.*)\.");
23 push @{$r->{"rules"}}, '^win32/config.h' => 's';
24 if ($ver =~ /-/) {
25 $r->{"ALPHADIR"} = "alpha/";
26 $r->{"conditions"}->{"ALPHA_VERSION"} = 1;
27 } else {
28 $r->{"ALPHADIR"} = "";
29 $r->{"conditions"}->{"ALPHA_VERSION"} = -1;
30 }
31 push @{$r->{"uploads"}}, {
32 "url" => "scp://jabberwock.ucw.cz/home/ftp/pub/mj/linux/pci/" . $r->{"ALPHADIR"}
33 ## },{
34 ## "url" => "scp://master.kernel.org/pub/software/utils/pciutils/" . $r->{"ALPHADIR"}
35 };
36 $r->ParseOptions;
37 $r->InitDist("maint/dist");
38 my $reldir = $r->GenPackage;
39 $r->GenFile("README");
40 $r->GenFile("pciutils.lsm");
41 $r->Dispatch;
42 if ($r->{"do_upload"}) {
43 print "Uploading pci.ids to Jabberwock\n";
44 `scp -C pci.ids pciids\@jabberwock.ucw.cz:05-pciutils.new`; die if $?;
45 `ssh pciids\@jabberwock.ucw.cz mv 05-pciutils.new origs/05-pciutils`; die if $?;
46 }
47
48 # Hacks for kernel.org
49 print "Preparing kernel.org package\n";
50 my $dd = $r->{"DISTDIR"};
51 my $pkg = $r->{"PKG"};
52 `gzip -d <$dd/$pkg.tar.gz >$dd/$pkg.tar`; die if $?;
53 system "gpg", "--armor", "--detach-sig", "-o", "$dd/$pkg.tar.sig", "$dd/$pkg.tar"; die if $?;
54 if ($r->{"do_upload"}) {
55 print "Uploading to kernel.org\n";
56 print "<confirm> "; <STDIN>;
57 system '/home/mj/tree/kup/kup', 'put', "$dd/$pkg.tar", "$dd/$pkg.tar.sig", "/pub/software/utils/pciutils/$pkg.tar.gz"; die if $?;
58 }
59
60 # GitHub releases
61 print "Creating a GitHub release\n";
62 my $ghrel = "v$ver";
63 `gh release create $ghrel --verify-tag --latest --notes "Automatically generated. Please see the ChangeLog for details."`;
64 die if $?;
65 `gh release upload $ghrel $dd/$pkg.tar.gz $dd/$pkg.tar.gz.sign`;
66 die if $?