introduce and use CvsCatfile for constructing CVS paths from an array. b=371325 r=preed. While we're in there, pick up a fix in Updates step to get oldVersion, and call Verify right after Execute for Tag substeps.
authorrhelmer@mozilla.com
Mon, 30 Apr 2007 13:55:21 -0700
changeset 939 cd3038204821bf19fb6bc3f96b0978917d573283
parent 938 3ccc0cec9986de8e75b6537e0989ec4748f740de
child 940 34d7ac5badac35e3f03c6a80970859ef15a6fa03
push idunknown
push userunknown
push dateunknown
reviewerspreed
bugs371325
milestone1.9a5pre
introduce and use CvsCatfile for constructing CVS paths from an array. b=371325 r=preed. While we're in there, pick up a fix in Updates step to get oldVersion, and call Verify right after Execute for Tag substeps.
tools/release/Bootstrap/Step/Repack.pm
tools/release/Bootstrap/Step/Stage.pm
tools/release/Bootstrap/Step/Tag.pm
tools/release/Bootstrap/Step/Tag/Bump.pm
tools/release/Bootstrap/Step/Tag/Talkback.pm
tools/release/Bootstrap/Step/Tag/l10n.pm
tools/release/Bootstrap/Step/TinderConfig.pm
tools/release/Bootstrap/Step/Updates.pm
tools/release/Bootstrap/Util.pm
--- a/tools/release/Bootstrap/Step/Repack.pm
+++ b/tools/release/Bootstrap/Step/Repack.pm
@@ -1,15 +1,16 @@
 #
 # Repack step. Unpacks, modifies, repacks a Firefox en-US build.
 # Primary use is for l10n (localization) builds.
 #
 package Bootstrap::Step::Repack;
 use Bootstrap::Step;
 use Bootstrap::Config;
+use Bootstrap::Util qw(CvsCatfile);
 use MozBuild::Util qw(MkdirWithPath);
 @ISA = ("Bootstrap::Step");
 
 sub Execute {
     my $this = shift;
 
     my $config = new Bootstrap::Config();
     my $l10n_buildDir = $config->Get(sysvar => 'l10n_buildDir');
@@ -60,17 +61,17 @@ sub Verify {
       or die("Cannot mkdir $verifyDirVersion: $!");
 
     # check out l10n verification scripts
     foreach my $dir ('common', 'l10n') {
         $this->Shell(
           cmd => 'cvs',
           cmdArgs => ['-d', $mozillaCvsroot, 
                       'co', '-d', $dir, 
-                      catfile('mozilla', 'testing', 'release', $dir)],
+                      CvsCatfile('mozilla', 'testing', 'release', $dir)],
           dir => $verifyDirVersion,
           logFile => catfile($logDir, 
                                'repack_checkout-l10n_verification.log'),
         );
     }
 
     # Download current release
     $this->Shell(
--- a/tools/release/Bootstrap/Step/Stage.pm
+++ b/tools/release/Bootstrap/Step/Stage.pm
@@ -1,16 +1,17 @@
 #
 # Stage step. Copies nightly build format filenames to release directory
 # structure.
 # 
 package Bootstrap::Step::Stage;
 
 use Bootstrap::Step;
 use Bootstrap::Config;
+use Bootstrap::Util qw(CvsCatfile);
 use File::Copy qw(copy move);
 use File::Find qw(find);
 use File::Path qw(rmtree);
 use File::Basename;
 use Cwd;
 
 use MozBuild::Util qw(MkdirWithPath);
 
@@ -353,17 +354,18 @@ sub Execute {
 
     # Remove unshipped files/locales and set proper mode on dirs; start
     # by checking out the shipped-locales file
     $ENV{'CVS_RSH'} = 'ssh';
     $this->Shell(cmd => 'cvs',
       cmdArgs => ['-d', $mozillaCvsroot, 
                   'co', '-dconfig',
                   '-r', $releaseTag,
-                  catfile('mozilla', $appName, 'locales', 'shipped-locales')],
+                  CvsCatfile('mozilla', $appName, 'locales', 
+                             'shipped-locales')],
       dir => catfile($stageDir, 'batch1'),
       logFile => catfile($logDir, 'stage-shipped-locales_checkout.log'));
 
     $this->{'localeManifest'} = {};
     if (not $this->LoadLocaleManifest(localeHashRef =>
                                        $this->{'localeManifest'},
                                        manifest => catfile($stageDir, 'batch1',
                                         'config', 'shipped-locales'))) {
--- a/tools/release/Bootstrap/Step/Tag.pm
+++ b/tools/release/Bootstrap/Step/Tag.pm
@@ -3,16 +3,17 @@
 # 
 package Bootstrap::Step::Tag;
 use Bootstrap::Step;
 use Bootstrap::Step::Tag::Bump;
 use Bootstrap::Step::Tag::Mozilla;
 use Bootstrap::Step::Tag::l10n;
 use Bootstrap::Step::Tag::Talkback;
 use Bootstrap::Config;
+use Bootstrap::Util qw(CvsCatfile);
 use File::Copy qw(move);
 use MozBuild::Util qw(MkdirWithPath);
 @ISA = qw(Bootstrap::Step);
 
 my @subSteps = ('Bump', 'Mozilla', 'l10n', 'Talkback');
 
 sub Execute {
     my $this = shift;
@@ -55,17 +56,17 @@ sub Execute {
     # TODO this should support running without branch tag or pull date.
 
     $this->Shell(
       cmd => 'cvs',
       cmdArgs => ['-d', $mozillaCvsroot, 
                   'co', 
                   '-r', $branchTag, 
                   '-D', $pullDate, 
-                  'mozilla/client.mk',
+                  CvsCatfile('mozilla', 'client.mk'),
                  ],
       dir => $cvsrootTagDir,
       logFile => catfile($logDir, 'tag_checkout_client_mk.log'),
     );
 
     $this->CheckLog(
       log => catfile($logDir, 'tag_checkout_client_mk.log'),
       checkForOnly => '^U mozilla/client.mk',
@@ -83,50 +84,35 @@ sub Execute {
     my $numSteps = scalar(@subSteps);
     my $currentStep = 0;
     while ($currentStep < $numSteps) {
         my $stepName = $subSteps[$currentStep];
         eval {
             $this->Log(msg => 'Tag running substep ' . $stepName);
             my $step = "Bootstrap::Step::Tag::$stepName"->new();
             $step->Execute();
+            $step->Verify();
         };
         if ($@) {
-            die("Tag substep $stepName Execute died: $@");
+            die("Tag substep $stepName died: $@");
         }
         $currentStep += 1;
     }
 }
 
 sub Verify {
     my $this = shift;
 
     my $config = new Bootstrap::Config();
     my $logDir = $config->Get(var => 'logDir');
 
     $this->CheckLog(
       log => catfile($logDir, 'tag_mozilla-checkout.log'),
       checkFor => '^U',
     );
-
-    # Call substeps
-    my $numSteps = scalar(@subSteps);
-    my $currentStep = 0;
-    while ($currentStep < $numSteps) {
-        my $stepName = $subSteps[$currentStep];
-        eval {
-            $this->Log(msg => 'Tag running substep ' . $stepName);
-            my $step = "Bootstrap::Step::Tag::$stepName"->new();
-            $step->Verify();
-        };
-        if ($@) {
-            die("Tag substep $stepName Verify died: $@");
-        }
-        $currentStep += 1;
-    }
 }
 
 sub CvsTag {
     my $this = shift;
     my %args = @_;
 
     my $config = new Bootstrap::Config();
     my $tagName = $args{'tagName'};
--- a/tools/release/Bootstrap/Step/Tag/Bump.pm
+++ b/tools/release/Bootstrap/Step/Tag/Bump.pm
@@ -1,15 +1,16 @@
 #
 # Tag::Bump substep. Bumps version files for Mozilla appropriately.
 # 
 package Bootstrap::Step::Tag::Bump;
 use Bootstrap::Step;
 use Bootstrap::Config;
 use Bootstrap::Step::Tag;
+use Bootstrap::Util qw(CvsCatfile);
 use File::Copy qw(move);
 use MozBuild::Util qw(MkdirWithPath);
 @ISA = ("Bootstrap::Step::Tag");
 
 sub Execute {
     my $this = shift;
 
     my $config = new Bootstrap::Config();
@@ -45,19 +46,20 @@ sub Execute {
     # Check out Mozilla from the branch you want to tag.
     # TODO this should support running without branch tag or pull date.
     $this->Shell(
       cmd => 'cvs',
       cmdArgs => ['-d', $mozillaCvsroot, 
                   'co', 
                   '-r', $branchTag, 
                   '-D', $pullDate, 
-                  catfile('mozilla', 'client.mk'),
-                  catfile('mozilla', $moduleVer),
-                  catfile('mozilla', $versionTxt),
+                  CvsCatfile('mozilla', 'client.mk'),
+                  CvsCatfile('mozilla', $appName, 'app', 'module.ver'),
+                  CvsCatfile('mozilla', $appName, 'config', 'version.txt'),
+                  CvsCatfile('mozilla', 'config', 'milestone.txt'),
                  ],
       dir => $cvsrootTagDir,
       logFile => catfile($logDir, 'tag-bump_checkout.log'),
     );
 
     # Create a minibranch for the pull scripts so we can change them without
     # changing anything on the original branch.
     $this->CvsTag(
@@ -129,17 +131,17 @@ sub Execute {
         }
 
         if (not move("$file.tmp",
                      "$file")) {
             die("Cannot rename $file.tmp to $file: $!");
         }
     }
 
-    my $bumpCiMsg = 'version bump, remove pre tag for ' 
+    my $bumpCiMsg = 'Automated version bump, remove pre tag for ' 
                         . $product . ' ' . $version . ' release on ' 
                         . $minibranchTag;
     $this->Shell(
       cmd => 'cvs',
       cmdArgs => ['commit', '-m', $bumpCiMsg, 
                   @bumpFiles,
                  ],
       dir => catfile($releaseTagDir, 'cvsroot', 'mozilla'),
@@ -162,18 +164,16 @@ sub Verify {
     my @bumpFiles = ('client.mk', $moduleVer, $versionTxt);
 
     # only bump milestone if it's defined in the config
     if (defined($milestone)) {
         @bumpFiles = (@bumpFiles, $milestoneTxt);
     }
 
     foreach my $file (@bumpFiles) {
-        foreach my $rule ('^Checking in ' . $file, '^done') {
-            $this->CheckLog(
-              log => catfile($logDir, 'tag-bump_checkin.log'),
-              checkFor => $rule,
-            );
-        }
+        $this->CheckLog(
+          log => catfile($logDir, 'tag-bump_checkin.log'),
+          checkFor => $file,
+        );
     }
 }
 
 1;
--- a/tools/release/Bootstrap/Step/Tag/Talkback.pm
+++ b/tools/release/Bootstrap/Step/Tag/Talkback.pm
@@ -1,15 +1,16 @@
 #
 # Tag step. Applies a CVS tag to the appropriate repositories.
 # 
 package Bootstrap::Step::Tag::Talkback;
 use Bootstrap::Step;
 use Bootstrap::Config;
 use Bootstrap::Step::Tag;
+use Bootstrap::Util qw(CvsCatfile);
 use File::Copy qw(move);
 use MozBuild::Util qw(MkdirWithPath);
 @ISA = ("Bootstrap::Step::Tag");
 
 sub Execute {
     my $this = shift;
 
     my $config = new Bootstrap::Config();
@@ -30,17 +31,17 @@ sub Execute {
         MkdirWithPath(dir => $mofoDir) 
           or die("Cannot mkdir $mofoDir: $!");
     }
 
     # Check out the talkback files from the branch you want to tag.
     $this->Shell(
       cmd => 'cvs',
       cmdArgs => ['-d', $mofoCvsroot, 'co', '-r', $branchTag, '-D', 
-                  $pullDate, catfile('talkback', 'fullsoft')],
+                  $pullDate, CvsCatfile('talkback', 'fullsoft')],
       dir => catfile($releaseTagDir, 'mofo'),
       logFile => catfile($logDir, 'tag-talkback_mofo-checkout.log'),
     );
 
     # Create the talkback RELEASE tag.
     $this->CvsTag(
       tagName => $releaseTag,
       coDir => catfile($releaseTagDir, 'mofo', 'talkback', 'fullsoft'),
--- a/tools/release/Bootstrap/Step/Tag/l10n.pm
+++ b/tools/release/Bootstrap/Step/Tag/l10n.pm
@@ -1,15 +1,16 @@
 #
 # Tag step. Applies a CVS tag to the appropriate repositories.
 # 
 package Bootstrap::Step::Tag::l10n;
 use Bootstrap::Step;
 use Bootstrap::Config;
 use Bootstrap::Step::Tag;
+use Bootstrap::Util qw(CvsCatfile);
 use File::Copy qw(move);
 use MozBuild::Util qw(MkdirWithPath);
 @ISA = ("Bootstrap::Step::Tag");
 
 sub Execute {
     my $this = shift;
 
     my $config = new Bootstrap::Config();
@@ -49,17 +50,17 @@ sub Execute {
         $locale =~ s/(\n)//;
         # skip en-US, this is the default locale
         if ($locale eq 'en-US') {
             next;
         }
         $this->Shell(
             cmd => 'cvs',
             cmdArgs => ['-d', $l10nCvsroot, 'co', '-r', $branchTag, '-D',
-                        $l10n_pullDate, catfile('l10n', $locale)],
+                        $l10n_pullDate, CvsCatfile('l10n', $locale)],
             dir => catfile($releaseTagDir, 'l10n'),
             logFile => catfile($logDir, 'tag-l10n_checkout.log'),
         );
     }
 
     # Create the l10n RELEASE and RC tags.
     foreach my $tag ($releaseTag, $rcTag) {
         $this->CvsTag(
--- a/tools/release/Bootstrap/Step/TinderConfig.pm
+++ b/tools/release/Bootstrap/Step/TinderConfig.pm
@@ -1,16 +1,17 @@
 ##
 # TinderConfig - creates config file for Tinderbox
 ##
 
 package Bootstrap::Step::TinderConfig;
 
 use Bootstrap::Step;
 use Bootstrap::Config;
+use Bootstrap::Util qw(CvsCatfile);
 use MozBuild::TinderLogParse;
 use MozBuild::Util qw(MkdirWithPath);
 
 @ISA = ("Bootstrap::Step");
 
 sub Execute {
     my $this = shift;
 
@@ -30,33 +31,33 @@ sub Execute {
       or die("Cannot mkdir $configBumpDir: $!");
 
     foreach my $branch ($branchTag . '_release', $branchTag . '_l10n_release') {
         $this->Shell(
           cmd => 'cvs',
           cmdArgs => ['-d', $mozillaCvsroot, 
                       'co', '-d', 'tinderbox-configs',
                       '-r', $branch,
-                      'mozilla/tools/tinderbox-configs/' . 
-                      $product . '/' . $osname],
+                      CvsCatfile('mozilla', 'tools', 'tinderbox-configs',
+                                 $product, $osname)],
           logFile => catfile($logDir, 
            'build_config-checkout-' . $branch . '.log'),
           dir => $configBumpDir,
         );
     
         foreach my $configFile ('tinder-config.pl', 'mozconfig') {
             $config->Bump( configFile => 
              catfile($configBumpDir, 'tinderbox-configs', $configFile));
             $this->Shell(
               cmd => 'cvs',
               cmdArgs => ['-d', $mozillaCvsroot, 
                           'ci', '-m', 
                           '"Automated configuration bump, release for ' 
                            . $product  . ' ' . $version . '"', 
-                          'tinderbox-configs/' . $configFile],
+                          CvsCatfile('tinderbox-configs', $configFile)],
               logFile => catfile($logDir, 
                'build_config-checkin-' . $configFile . '-' . 
                 $branch . '.log'),
               dir => catfile($configBumpDir),
             );
         }
     }
 }
--- a/tools/release/Bootstrap/Step/Updates.pm
+++ b/tools/release/Bootstrap/Step/Updates.pm
@@ -1,25 +1,27 @@
 #
 # Updates step. Generates binary update (MAR) files as well as AUS config
 # snippets.
 # 
 package Bootstrap::Step::Updates;
 use Bootstrap::Step;
 use Bootstrap::Config;
+use Bootstrap::Util qw(CvsCatfile);
 use File::Find qw(find);
 use MozBuild::Util qw(MkdirWithPath);
 @ISA = ("Bootstrap::Step");
 
 sub Execute {
     my $this = shift;
 
     my $config = new Bootstrap::Config();
     my $product = $config->Get(var => 'product');
     my $logDir = $config->Get(var => 'logDir');
+    my $oldVersion = $config->Get(var => 'oldVersion');
     my $version = $config->Get(var => 'version');
     my $mozillaCvsroot = $config->Get(var => 'mozillaCvsroot');
     my $mofoCvsroot = $config->Get(var => 'mofoCvsroot');
     my $updateDir = $config->Get(var => 'updateDir');
     my $patcherConfig = $config->Get(var => 'patcherConfig');
     my $patcherToolsRev = $config->Get(var => 'patcherToolsRev');
 
     my $versionedUpdateDir = catfile($updateDir, $product . '-' . $version);
@@ -29,35 +31,35 @@ sub Execute {
         MkdirWithPath(dir => $versionedUpdateDir) 
           or die("Cannot mkdir $versionedUpdateDir: $!");
     }
 
     # check out patcher
     $this->Shell(
       cmd => 'cvs',
       cmdArgs => ['-d', $mozillaCvsroot, 'co', '-d', 'patcher', 
-                    catfile('mozilla', 'tools', 'patcher')],
+                  CvsCatfile('mozilla', 'tools', 'patcher')],
       logFile => catfile($logDir, 'updates_patcher-checkout.log'),
       dir => $versionedUpdateDir,
     );
 
     # check out utilities
     $this->Shell(
       cmd => 'cvs',
       cmdArgs => ['-d', $mozillaCvsroot, 'co', '-d', 'MozBuild', 
-                    catfile('mozilla', 'tools', 'release', 'MozBuild')],
+                  CvsCatfile('mozilla', 'tools', 'release', 'MozBuild')],
       logFile => catfile($logDir, 'updates_patcher-utils-checkout.log'),
       dir => catfile($versionedUpdateDir, 'patcher'),
     );
 
     # config lives in private repo
     $this->Shell(
       cmd => 'cvs',
       cmdArgs => ['-d', $mofoCvsroot, 'co', '-d', 'config',  
-                    catfile('release', 'patcher', $patcherConfig)],
+                  CvsCatfile('release', 'patcher', $patcherConfig)],
       logFile => catfile($logDir, 'updates_patcher-config-checkout.log'),
       dir => $versionedUpdateDir,
     );
 
     # build tools
     my $originalCvsrootEnv = $ENV{'CVSROOT'};
     $ENV{'CVSROOT'} = $mozillaCvsroot;
     $this->Shell(
@@ -100,32 +102,31 @@ sub Execute {
 }
 
 sub Verify {
     my $this = shift;
 
     my $config = new Bootstrap::Config();
     my $logDir = $config->Get(var => 'logDir');
     my $version = $config->Get(var => 'version');
-    my $oldVersion = $config->Get(var => 'oldVersion');
     my $mozillaCvsroot = $config->Get(var => 'mozillaCvsroot');
     my $verifyDir = $config->Get(var => 'verifyDir');
     my $product = $config->Get(var => 'product');
     my $verifyConfig = $config->Get(sysvar => 'verifyConfig');
 
     # Create verification area.
     my $verifyDirVersion = catfile($verifyDir, $product . '-' . $version);
     MkdirWithPath(dir => $verifyDirVersion) 
       or die("Could not mkdir $verifyDirVersion: $!");
 
     foreach my $dir ('updates', 'common') {
         $this->Shell(
           cmd => 'cvs',
           cmdArgs => ['-d', $mozillaCvsroot, 'co', '-d', $dir,
-                        catfile('mozilla', 'testing', 'release', $dir)],
+                      CvsCatfile('mozilla', 'testing', 'release', $dir)],
           logFile => catfile($logDir, 
                                'updates_verify_checkout-' . $dir . '.log'),
           dir => $verifyDirVersion,
         );
     }
     
     # Customize updates.cfg to contain the channels you are interested in 
     # testing.
new file mode 100644
--- /dev/null
+++ b/tools/release/Bootstrap/Util.pm
@@ -0,0 +1,24 @@
+#
+# Bootstrap utility functions.
+# 
+
+package Bootstrap::Util;
+
+use base qw(Exporter);
+
+our @EXPORT_OK = qw(CvsCatfile);
+
+use strict;
+
+##
+# Turn an array of directory/filenames into a CVS module path.
+# ( name comes from File::Spec::catfile() )
+#
+# Note that this function does not take any arguments, to make the usage
+# more like File::Spec::catfile()
+##
+sub CvsCatfile {
+   return join('/', @_);
+}
+
+1;