From 45c44493ab89f6893e957f4d0bc7ba2778b1c041 Mon Sep 17 00:00:00 2001 From: "rhelmer@mozilla.com" Date: Wed, 11 Jul 2007 20:57:18 -0700 Subject: [PATCH] bump all relevant tags in client.mk b=387426 r=preed r=cf --- tools/release/Bootstrap/Step/Tag/Bump.pm | 49 ++++++++++++++++-------- 1 file changed, 33 insertions(+), 16 deletions(-) diff --git a/tools/release/Bootstrap/Step/Tag/Bump.pm b/tools/release/Bootstrap/Step/Tag/Bump.pm index 167a7e07ee39..90960b58e641 100644 --- a/tools/release/Bootstrap/Step/Tag/Bump.pm +++ b/tools/release/Bootstrap/Step/Tag/Bump.pm @@ -89,36 +89,52 @@ sub Execute { my $bumpVersion = undef; my $preVersion = undef; - my $search = undef; - my $replace = undef; + my %searchReplace = (); + # Order or searching for these values is not preserved, so make + # sure that the order replacement happens does not matter. if ($fileName eq 'client.mk') { - $search = '^MOZ_CO_TAG\s+=\s+' . $branchTag . '$'; - $replace = 'MOZ_CO_TAG = ' . $releaseTag; + %searchReplace = ( + '^MOZ_CO_TAG\s+=\s+' . $branchTag . '$' => + 'MOZ_CO_TAG = ' . $releaseTag, + '^NSPR_CO_TAG\s+=\s+\w*' => + 'NSPR_CO_TAG = ' . $releaseTag, + '^NSS_CO_TAG\s+=\s+\w*' => + 'NSS_CO_TAG = ' . $releaseTag, + '^LOCALES_CO_TAG\s+=\s+' . $branchTag . '$' => + 'LOCALES_CO_TAG = ' . $releaseTag, + '^LDAPCSDK_CO_TAG\s+=\s+' . $branchTag . '$' => + 'LDAPCSDK_CO_TAG = ' . $releaseTag); } elsif ($fileName eq $moduleVer) { $preVersion = $version . 'pre'; - $search = '^WIN32_MODULE_PRODUCTVERSION_STRING=' . $preVersion . '$'; - $replace = 'WIN32_MODULE_PRODUCTVERSION_STRING=' . $version; + %searchReplace = ('^WIN32_MODULE_PRODUCTVERSION_STRING=' . + $preVersion . '$' => 'WIN32_MODULE_PRODUCTVERSION_STRING=' . + $version); } elsif ($fileName eq $versionTxt) { $preVersion = $version . 'pre'; - $search = '^' . $preVersion . '$'; - $replace = $version; + %searchReplace = ('^' . $preVersion . '$' => $version); } elsif ($fileName eq $milestoneTxt) { $preVersion = $milestone . 'pre'; - $search = '^' . $preVersion . '$'; - $replace = $milestone; + %searchReplace = ('^' . $preVersion . '$' => $milestone); } else { die("ASSERT: do not know how to bump file $fileName"); } + + if (scalar(keys(%searchReplace)) <= 0) { + die("ASSERT: no search/replace to perform"); + } open(INFILE, "< $file") or die("Could not open $file: $!"); open(OUTFILE, "> $file.tmp") or die("Could not open $file.tmp: $!"); while() { - if($_ =~ /$search/) { - $this->Log(msg => "$search found"); - $found = 1; - $_ =~ s/$search/$replace/; - $this->Log(msg => "$search replaced with $replace"); + foreach my $search (keys(%searchReplace)) { + my $replace = $searchReplace{$search}; + if($_ =~ /$search/) { + $this->Log(msg => "$search found"); + $found = 1; + $_ =~ s/$search/$replace/; + $this->Log(msg => "$search replaced with $replace"); + } } print OUTFILE $_; @@ -126,7 +142,8 @@ sub Execute { close INFILE or die("Could not close $file: $!"); close OUTFILE or die("Coule not close $file.tmp: $!"); if (not $found) { - die("No " . $search . " found in file $file: $!"); + die("None of " . join(keys(%searchReplace)) . + " found in file $file: $!"); } if (not move("$file.tmp",