+sub make_version_script {
+ my $context = shift;
+
+ my $variant = substr( $context->{release}, length($context->{trelease}) );
+ if ( $context->{release} ne $context->{trelease} . $variant ) {
+ die "Broken version numbering, I'm buggy";
+ }
+
+ my $srcdir = File::Spec->catdir( $context->{release_tree}, 'src', 'src' );
+ chdir $srcdir or die "chdir $srcdir: $\n";
+
+ if ( -f "version.sh" ) {
+ print( "WARNING: version.sh already exists - leaving it in place\n" );
+ return;
+ }
+
+ my @cmd = ("../scripts/reversion", "release");
+ print( "Running: ", join( ' ', @cmd ), "\n" ) if ($verbose);
+ system(@cmd) == 0 || croak "reversion failed";
+
+ unlink "version.h";
+
+ -f "version.sh" or die "failed to create version.h";
+}
+
+# ------------------------------------------------------------------
+