19 "tagpoint=s" => \$tagPoint,
24 pod2usage(1) if $help;
25 pod2usage(-exitstatus => 0, -verbose => 2) if $man;
30 pod2usage(2) if !defined($tagName);
35 system ("git tag -s $tagName $tagPoint") == 0
36 or die "git tag failed with : $!";
38 # Push the tag upstream
39 system ("git push ssh://gerrit.openafs.org:29418/openafs tag $tagName") == 0
40 or die "git push failed with : $!";
43 $version = `git describe --abbrev=4 $tagName`;
45 $version=~s/openafs-[^-]*-//;
48 # Grab the tagged code into a temporary directory
50 my $name = "openafs-".$version;
52 my $tempDir = File::Temp::tempdir();
53 system ("git archive --format=tar --prefix=$name/ $tagName ".
54 " | tar -C $tempDir -x") == 0
55 or die "Git archive failed with: $?";
57 # Construct the ChangeLog
59 system("git log $last..$tagName > $outDir/ChangeLog");
61 system("git log $tagName > $outDir/ChangeLog");
65 system("git describe --abbrev=4 $tagName > $tempDir/$name/.version");
67 # Run regen.sh to create the rest of the tree
68 system ("cd $tempDir/$name && ./regen.sh") == 0
71 # A list of files to compress
74 # Create the documentation tarball
75 system("tar -cf $outDir/$name-doc.tar -C $tempDir $name/doc") == 0
76 or die "Unable to create documentation tarball : $!";
77 push @toCompress, "$outDir/$name-doc.tar";
79 # Remove the docs directory (we've already build a tarball for it)
80 File::Path::rmtree("$tempDir/$name/doc");
82 # Create the source tarball (both .gz and .bz2)
83 system("tar -cf $outDir/$name-src.tar -C $tempDir $name") == 0
84 or die "Unable to create source code tarball : $!";
85 push @toCompress, "$outDir/$name-src.tar";
87 # Construct the diffs, and zip them
89 system("git diff $last..$tagName > $outDir/$name.diff") == 0
90 or die "Unable to create diff : $!";
91 push @toCompress, "$outDir/$name.diff";
96 # Compress everything that needs squashing,
97 # and also set up a list for md5 checksumming.
98 foreach my $file (@toCompress) {
99 system("gzip < $file > $file.gz") == 0
100 or die "Unable to create gzip file of '$file' : $!";
101 push @toMD5, "$file.gz";
103 system("bzip2 < $file > $file.bz2") == 0
104 or die "Unable to create bzip file of '$file' : $!";
105 push @toMD5, "$file.bz2";
107 # Delete the uncompressed tar files.
108 if ($file =~ /\.tar$/) {
111 # Otherwise, queue this file for md5 checksumming.
116 foreach my $file (@toMD5) {
117 if (-x "/sbin/md5") {
118 system("/sbin/md5 -q $file > $file.md5");
119 } elsif (-x "/usr/bin/md5sum") {
120 system("/usr/bin/md5sum $file > $file.md5");
122 print STDERR "No md5 utility found. Not producing checksums\n";
131 make-release - Make an OpenAFS release from git
135 make-release [options] <tag> [<version>]
138 --help brief help message
139 --man full documentation
140 --tagpoint <object> create new tag
141 --last <object> generate changelog and diffs from this point
142 --dir <dir> output results into this directory
146 make-release constructs an OpenAFS release from a local git clone. If run
147 with just the standard arguments, it will extract the contents of the
148 specified tag into the current directory, creating src and doc tarballs,
149 gzipping and bzipping them, and generating md5 hashes. It will also create a
150 ChangeLog file, listing all of the changes in that release.
152 This standard behaviour may be modified by the following options
158 =item B<--last> I<object>
160 Generate the ChangeLog starting from I<object>. Also generate a
161 openafs-$version.diff file in the output directory containing all of the
162 changes between I<object> and the current tag
164 =item B<--dir> I<directory>
166 Instead of generating all of the output in the current directory, place it
167 in <directory>, which must already exist.
169 =item B<--tagpoint> I<commit|branch>
171 Rather than using an existing tag, create a new one on the specified commit,
172 or on the tip of the specified branch. This will GPG sign the new tag, and