diff --git a/build-tools/make-release b/build-tools/make-release index 0617d2820c..7ef82e79ad 100755 --- a/build-tools/make-release +++ b/build-tools/make-release @@ -45,13 +45,16 @@ if ($tagPoint) { 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 @@ -68,7 +71,10 @@ if ($last) { } # 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