pod2usage(-exitstatus => 0, -verbose => 2) if $man;
my $tagName = shift;
-my $version = shift;
+my $notused = shift; # Used to be "version".
pod2usage(2) if !defined($tagName);
+if (defined $notused) {
+ warn "Warning: argument '$notused' is ignored.\n";
+}
# Tag the repository
or die "git push failed with : $!";
}
-$version = `git describe --abbrev=4 $tagName`;
+my $version = `git describe --abbrev=4 $tagName`;
chomp $version;
-$version=~s/openafs-[^-]*-//;
-$version=~s/_/./g;
+if (!$version) {
+ die "Failed to describe $tagName.\n";
+}
+my $suffix = $version;
+$suffix =~ s/openafs-[^-]*-//;
+$suffix =~ s/_/./g;
+my $name = "openafs-$suffix";
# Grab the tagged code into a temporary directory
-my $name = "openafs-".$version;
-
my $tempDir = File::Temp::tempdir();
system ("git archive --format=tar --prefix=$name/ $tagName ".
" | tar -C $tempDir -x") == 0
or die "Git archive failed with: $?";
+# Make the output path, if not already present.
+File::Path::mkpath($outDir);
+
# Construct the ChangeLog
if ($last) {
system("git log $last..$tagName > $outDir/ChangeLog");
}
# Describe the tree
-system("git describe --abbrev=4 $tagName > $tempDir/$name/.version");
+open(my $fh, ">", "$tempDir/$name/.version") or
+ die "Failed to open $tempDir/$name/.version: $!\n";
+print $fh "$version\n";
+close($fh);
# Run regen.sh to create the rest of the tree
system ("cd $tempDir/$name && ./regen.sh") == 0
=head1 SYNOPSIS
-make-release [options] <tag> [<version>]
+make-release [options] <tag>
Options:
--help brief help message
=item B<--dir> I<directory>
Instead of generating all of the output in the current directory, place it
-in <directory>, which must already exist.
+in <directory>, which is created if it does not already exist.
=item B<--tagpoint> I<commit|branch>