19 "tagpoint=s" => \$tagPoint,
24 pod2usage(1) if $help;
25 pod2usage(-exitstatus => 0, -verbose => 2) if $man;
28 my $notused = shift; # Used to be "version".
30 pod2usage(2) if !defined($tagName);
31 if (defined $notused) {
32 warn "Warning: argument '$notused' is ignored.\n";
38 system ("git tag -s $tagName $tagPoint") == 0
39 or die "git tag failed with : $!";
41 # Push the tag upstream
42 system ("git push ssh://gerrit.openafs.org:29418/openafs tag $tagName") == 0
43 or die "git push failed with : $!";
46 my $version = `git describe --abbrev=4 $tagName`;
48 $version=~s/openafs-[^-]*-//;
51 # Grab the tagged code into a temporary directory
53 my $name = "openafs-".$version;
55 my $tempDir = File::Temp::tempdir();
56 system ("git archive --format=tar --prefix=$name/ $tagName ".
57 " | tar -C $tempDir -x") == 0
58 or die "Git archive failed with: $?";
60 # Construct the ChangeLog
62 system("git log $last..$tagName > $outDir/ChangeLog");
64 system("git log $tagName > $outDir/ChangeLog");
68 system("git describe --abbrev=4 $tagName > $tempDir/$name/.version");
70 # Run regen.sh to create the rest of the tree
71 system ("cd $tempDir/$name && ./regen.sh") == 0
74 # A list of files to compress
77 # Create the documentation tarball
78 system("tar -cf $outDir/$name-doc.tar -C $tempDir $name/doc") == 0
79 or die "Unable to create documentation tarball : $!";
80 push @toCompress, "$outDir/$name-doc.tar";
82 # Remove the docs directory (we've already build a tarball for it)
83 File::Path::rmtree("$tempDir/$name/doc");
85 # Create the source tarball (both .gz and .bz2)
86 system("tar -cf $outDir/$name-src.tar -C $tempDir $name") == 0
87 or die "Unable to create source code tarball : $!";
88 push @toCompress, "$outDir/$name-src.tar";
90 # Construct the diffs, and zip them
92 system("git diff $last..$tagName > $outDir/$name.diff") == 0
93 or die "Unable to create diff : $!";
94 push @toCompress, "$outDir/$name.diff";
99 # Compress everything that needs squashing,
100 # and also set up a list for md5 checksumming.
101 foreach my $file (@toCompress) {
102 system("gzip < $file > $file.gz") == 0
103 or die "Unable to create gzip file of '$file' : $!";
104 push @toMD5, "$file.gz";
106 system("bzip2 < $file > $file.bz2") == 0
107 or die "Unable to create bzip file of '$file' : $!";
108 push @toMD5, "$file.bz2";
110 # Delete the uncompressed tar files.
111 if ($file =~ /\.tar$/) {
114 # Otherwise, queue this file for md5 checksumming.
119 foreach my $file (@toMD5) {
120 if (-x "/sbin/md5") {
121 system("/sbin/md5 -q $file > $file.md5");
122 } elsif (-x "/usr/bin/md5sum") {
123 system("/usr/bin/md5sum $file > $file.md5");
125 print STDERR "No md5 utility found. Not producing checksums\n";
134 make-release - Make an OpenAFS release from git
138 make-release [options] <tag>
141 --help brief help message
142 --man full documentation
143 --tagpoint <object> create new tag
144 --last <object> generate changelog and diffs from this point
145 --dir <dir> output results into this directory
149 make-release constructs an OpenAFS release from a local git clone. If run
150 with just the standard arguments, it will extract the contents of the
151 specified tag into the current directory, creating src and doc tarballs,
152 gzipping and bzipping them, and generating md5 hashes. It will also create a
153 ChangeLog file, listing all of the changes in that release.
155 This standard behaviour may be modified by the following options
161 =item B<--last> I<object>
163 Generate the ChangeLog starting from I<object>. Also generate a
164 openafs-$version.diff file in the output directory containing all of the
165 changes between I<object> and the current tag
167 =item B<--dir> I<directory>
169 Instead of generating all of the output in the current directory, place it
170 in <directory>, which must already exist.
172 =item B<--tagpoint> I<commit|branch>
174 Rather than using an existing tag, create a new one on the specified commit,
175 or on the tip of the specified branch. This will GPG sign the new tag, and