From 519c8de16f8bc738f1b10178b7b2f68ffb4bb8bb Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Mon, 20 Feb 2006 19:36:56 +0000 Subject: [PATCH] - Moved the checkout of the cvs source above the version prompting so that we can use the version from the configure.in file to provide good default values for the user. - When moving old tar/diff files into the old-* dirs, first hard-link them into place, then (if "live"), use rsync to update these new files on the server (which saves us later re-sending), and _then_ delete the old names. --- packaging/release-rsync | 87 ++++++++++++++++++++++++++++------------- 1 file changed, 60 insertions(+), 27 deletions(-) diff --git a/packaging/release-rsync b/packaging/release-rsync index fa6761d1..28bd8c85 100755 --- a/packaging/release-rsync +++ b/packaging/release-rsync @@ -40,24 +40,54 @@ if ($live) { } die "$dest does not exist\n" unless -d $dest; -print "\nPlease enter the version number of this release: "; -my $version = ; -chomp $version; +print "Checking out the latest rsync into $releasedir...\n"; + +mkdir($releasedir, 0755) or die $! unless -d $releasedir; +chdir($releasedir) or die $!; + +system "rm -rf rsync rsync-*"; + +system "cvs checkout -P rsync"; + +chdir('rsync') or die $!; + +my($version, $lastversion); +open(IN, 'configure.in') or die $!; +while () { + if (/^RSYNC_VERSION=(.*)/) { + $version = $lastversion = $1; + last; + } +} +close IN; + +$lastversion =~ s/(\d+)cvs$/ $1 - 1 /e; +$version =~ s/cvs/pre1/ || $version =~ s/pre(\d+)/ 'pre' . ($1 + 1) /e; + +print "\nPlease enter the version number of this release: [$version] "; +chomp($_ = ); +if ($_ eq '.') { + $version =~ s/pre\d+//; +} elsif ($_ ne '') { + $version = $_; +} $version =~ s/[-.]*pre[-.]*/pre/; +$lastversion =~ s/(\d+)pre\d+$/ $1 - 1 /e unless $version =~ /pre/; + my $cvstag = "release-$version"; $cvstag =~ s/[.]/-/g; $cvstag =~ s/pre/-pre/; -print "Enter the previous version to produce a patch against: "; -my $lastversion = ; -chomp $lastversion; +print "Enter the previous version to produce a patch against: [$lastversion] "; +chomp($_ = ); +$lastversion = $_ if $_ ne ''; $lastversion =~ s/[-.]*pre[-.]*/pre/; -print "Please enter the RPM release number of this release (default 1): "; -my $release = ; -chomp $release; -$release = 1 if $release eq ''; +my $release = 1; +print "Please enter the RPM release number of this release: [$release] "; +chomp($_ = ); +$release = $_ if $_ ne ''; my $diffdir; if ($lastversion =~ /pre/) { @@ -84,8 +114,6 @@ print < "; $_ = ; -mkdir($releasedir, 0755) or die $! unless -d $releasedir; -chdir($releasedir) or die $!; - -system "rm -rf rsync rsync-$version rsync-$lastversion"; - -system "cvs checkout -P rsync"; - -chdir('rsync') or die $!; - print $dots; system "./prepare-source && touch proto.h"; @@ -162,13 +181,15 @@ if ($live) { system "cvs commit -m 'Preparing for release of $version'"; system "cvs tag -F $cvstag ."; } else { - print "\n**** Skipping cvs commit and tagging in TESTMODE ****\n"; + print "**** Skipping cvs commit and tagging in TESTMODE ****\n"; } print <