Bug 387970: Release regressions in _M5; this takes care of the ftp/pub/firefox/nightly/$version-candidates directory having the incorrect permission upon creation. r=cf
authorpreed@mozilla.com
Wed, 15 Aug 2007 16:50:13 -0700
changeset 4699 3edf26c5ee6c979eea3cda9157f96b4f15bbeb21
parent 4698 959a4cfbe512769ca67846ddf343a844b21e4da8
child 4700 22cff1bbf34f2a7435eddf76095c917a6a238e23
push idunknown
push userunknown
push dateunknown
reviewerscf
bugs387970
milestone1.9a8pre
Bug 387970: Release regressions in _M5; this takes care of the ftp/pub/firefox/nightly/$version-candidates directory having the incorrect permission upon creation. r=cf
tools/release/Bootstrap/Config.pm
tools/release/Bootstrap/Step/Build.pm
--- a/tools/release/Bootstrap/Config.pm
+++ b/tools/release/Bootstrap/Config.pm
@@ -145,19 +145,19 @@ sub GetFtpCandidateDir {
     my $this = shift;
     my %args = @_;
 
     if (! defined($args{'bitsUnsigned'})) {
       die "ASSERT: Bootstep::Config::GetFtpCandidateDir(): bitsUnsigned is a required argument";
     }
     my $bitsUnsigned = $args{'bitsUnsigned'};
 
-    my $product = $config{'product'};
-    my $version = $config{'version'};
-    my $rc = $config{'rc'};
+    my $product = $this->Get('product');
+    my $version = $this->Get('version');
+    my $rc = $this->Get('rc');
 
     my $candidateDir = CvsCatfile('/home', 'ftp', 'pub', $product, 'nightly',
                             $version . '-candidates', 'rc' . $rc ) . '/';
 
     my $osFileMatch = $this->SystemInfo(var => 'osname');
 
     if ($bitsUnsigned && ($osFileMatch eq 'win32')  && ($version ge '2.0')) {
         $candidateDir .= 'unsigned/';
--- a/tools/release/Bootstrap/Step/Build.pm
+++ b/tools/release/Bootstrap/Step/Build.pm
@@ -107,16 +107,37 @@ sub Push {
 
     $this->Shell(
       cmd => 'ssh',
       cmdArgs => ['-2', '-l', $sshUser, $sshServer,
                   'mkdir -p ' . $candidateDir],
       logFile => $pushLog,
     );
 
+    # Make sure permissions are created on the server correctly;
+    #
+    # Note the '..' at the end of the chmod string; this is because
+    # Config::GetFtpCandidateDir() returns the full path, including the
+    # rcN directories on the end. What we really want to ensure
+    # have the correct permissions (from the mkdir call above) is the
+    # firefox/nightly/$version-candidates/ directory.
+    #
+    # XXX - This is ugly; another solution is to fix the umask on stage, or
+    # change what GetFtpCandidateDir() returns.
+
+    my $chmodArg = CvsCatfile($config->GetFtpCandidateDir(bitsUnsigned => 0), 
+     '..');
+
+    $this->Shell(
+      cmd => 'ssh',
+      cmdArgs => ['-2', '-l', $sshUser, $sshServer,
+                  'chmod 0755 ' . $chmodArg],
+      logFile => $pushLog,
+    );
+
     $this->Shell(
       cmd => 'ssh',
       cmdArgs => ['-2', '-l', $sshUser, $sshServer,
                   'rsync', '-av', 
                   '--include=*' . $osFileMatch . '*',
                   '--exclude=*', 
                   $pushDir, 
                   $candidateDir],