add deb repacks. bug 527076, r=coop FIREFOX_3_6b3_RELEASE
authorAki Sasaki <asasaki@mozilla.com>
Fri, 13 Nov 2009 15:33:45 -0800
changeset 490 1545d31b5e92642d394eef03d5952e567856596f
parent 489 e3e379541462c505254efb47c673a2c6ca64711b
child 491 14ab916a2a9d8491f35fd62665b772675d1fb013
push id262
push userasasaki@mozilla.com
push dateFri, 13 Nov 2009 23:34:45 +0000
reviewerscoop
bugs527076
add deb repacks. bug 527076, r=coop
process/factory.py
--- a/process/factory.py
+++ b/process/factory.py
@@ -1217,29 +1217,34 @@ class BaseRepackFactory(MozillaBuildFact
             'mozilla-1.9.1-win32-l10n-nightly',
     ]
 
     extraConfigureArgs = []
 
     def __init__(self, project, appName, l10nRepoPath,
                  compareLocalesRepoPath, compareLocalesTag,
                  stageServer, stageUsername, stageSshKey=None,
+                 mozconfig=None, configRepoPath=None, configSubDir=None,
                  baseWorkDir='build', tree="notset", mozillaDir=None,
                  **kwargs):
         MozillaBuildFactory.__init__(self, **kwargs)
 
         self.project = project
         self.appName = appName
         self.l10nRepoPath = l10nRepoPath
         self.compareLocalesRepoPath = compareLocalesRepoPath
         self.compareLocalesTag = compareLocalesTag
         self.stageServer = stageServer
         self.stageUsername = stageUsername
         self.stageSshKey = stageSshKey
         self.tree = tree
+        if mozconfig and configSubDir and configRepoPath:
+            self.mozconfig = 'configs/%s/%s/mozconfig' % (configSubDir,
+                                                          mozconfig)
+            self.configRepoPath = configRepoPath
 
         self.addStep(SetProperty,
                      command=['echo', self.tree],
                      property='tree',
                      workdir='.',
                      haltOnFailure=True
                      )
 
@@ -1266,27 +1271,37 @@ class BaseRepackFactory(MozillaBuildFact
         })
         if stageSshKey:
             self.uploadEnv['UPLOAD_SSH_KEY'] = '~/.ssh/%s' % stageSshKey
 
         self.preClean()
 
         self.addStep(ShellCommand,
          name='mkdir_l10nrepopath',
-         command=['sh', '-c', 'mkdir -p %s' % l10nRepoPath],
-         descriptionDone='mkdir '+ l10nRepoPath,
+         command=['sh', '-c', 'mkdir -p %s' % self.l10nRepoPath],
+         descriptionDone='mkdir '+ self.l10nRepoPath,
          workdir=self.baseWorkDir,
          flunkOnFailure=False
         )
 
         # call out to overridable functions
         self.getSources()
         self.updateSources()
         self.getMozconfig()
-
+        self.configure()
+        self.tinderboxPrintBuildInfo()
+        self.downloadBuilds()
+        self.updateEnUS()
+        self.tinderboxPrintRevisions()
+        self.compareLocalesSetup()
+        self.compareLocales()
+        self.doRepack()
+        self.doUpload()
+
+    def configure(self):
         self.addStep(ShellCommand,
          name='autoconf',
          command=['bash', '-c', 'autoconf-2.13'],
          haltOnFailure=True,
          descriptionDone=['autoconf'],
          workdir='%s/%s' % (self.baseWorkDir, self.origSrcDir)
         )
         if (self.mozillaDir):
@@ -1303,40 +1318,31 @@ class BaseRepackFactory(MozillaBuildFact
          haltOnFailure=True,
          descriptionDone=['autoconf js/src'],
          workdir='%s/%s/js/src' % (self.baseWorkDir, self.mozillaSrcDir)
         )
         self.addStep(ShellCommand,
          name='configure',
          command=['sh', '--',
                   './configure', '--enable-application=%s' % self.appName,
-                  '--with-l10n-base=../%s' % l10nRepoPath ] +
+                  '--with-l10n-base=../%s' % self.l10nRepoPath ] +
                   self.extraConfigureArgs,
          description='configure',
          descriptionDone='configure done',
          haltOnFailure=True,
          workdir='%s/%s' % (self.baseWorkDir, self.origSrcDir)
         )
         self.addStep(ShellCommand,
          name='make_config',
          command=['make'],
          workdir='%s/%s/config' % (self.baseWorkDir, self.mozillaSrcDir),
          description=['make config'],
          haltOnFailure=True
         )
 
-        self.tinderboxPrintBuildInfo()
-        self.downloadBuilds()
-        self.updateEnUS()
-        self.tinderboxPrintRevisions()
-        self.compareLocalesSetup()
-        self.compareLocales()
-        self.doRepack()
-        self.doUpload()
-
     def tinderboxPrint(self, propName, propValue):
         self.addStep(ShellCommand,
                      name='tinderboxprint_%s' % propName,
                      command=['echo',
                               'TinderboxPrint:',
                               '%s:' % propName,
                               propValue]
         )
@@ -5030,16 +5036,17 @@ class MobileNightlyRepackFactory(BaseRep
                      'dist/l10n-stage/%s/application.ini' % self.project,
                      'App', 'BuildID'],
             property='buildid',
             workdir='%s/%s' % (self.baseWorkDir, self.origSrcDir),
             description=['getting', 'buildid'],
             descriptionDone=['got', 'buildid']
         )
         self.addStep(MozillaStageUpload,
+            name='upload',
             objdir="%s/dist" % (self.origSrcDir),
             username=self.stageUsername,
             milestone=self.baseUploadDir,
             platform=platform,
             remoteHost=self.stageServer,
             remoteBasePath=self.stageBasePath,
             group=self.stageGroup,
             packageGlob=WithProperties('%s' % self.packageGlob),
@@ -5070,16 +5077,83 @@ class MobileNightlyRepackFactory(BaseRep
         )
 
 
 class MaemoNightlyRepackFactory(MobileNightlyRepackFactory):
     extraConfigureArgs = ['--target=arm-linux-gnueabi']
 
     def __init__(self, **kwargs):
         MobileNightlyRepackFactory.__init__(self, **kwargs)
+        assert self.configRepoPath
+
+    def getMozconfig(self):
+        self.addStep(ShellCommand,
+            name='rm_configs',
+            command=['rm', '-rf', 'configs'],
+            workdir=self.baseWorkDir,
+            description=['removing', 'configs'],
+            descriptionDone=['remove', 'configs'],
+            haltOnFailure=True
+        )
+        self.addStep(ShellCommand,
+            name='pull_configs',
+            command=['hg', 'clone', 'http://%s/%s' % (self.hgHost,
+                                              self.configRepoPath),
+                     'configs'],
+            workdir=self.baseWorkDir,
+            timeout=30*60 # 30 minutes
+        )
+        self.addStep(ShellCommand,
+            name='copy_mozconfig',
+            command=['cp', self.mozconfig,
+                     '%s/.mozconfig' % self.origSrcDir],
+            workdir=self.baseWorkDir,
+            description=['copying', 'mozconfig'],
+            descriptionDone=['copied', 'mozconfig'],
+            haltOnFailure=True
+        )
+        self.addStep(ShellCommand,
+            name='cat_mozconfig',
+            command=['cat', '.mozconfig'],
+            workdir='%s/%s' % (self.baseWorkDir, self.branchName),
+            description=['cat', 'mozconfig']
+        )
+
+    def downloadBuilds(self):
+        MobileNightlyRepackFactory.downloadBuilds(self)
+        self.addStep(ShellCommand,
+         name='wget_deb',
+         command=['make', 'wget-deb', 'EN_US_BINARY_URL=%s' % self.enUSBinaryURL,
+                  'DEB_BUILD_ARCH=armel'],
+         workdir='%s/%s/%s/locales' % (self.baseWorkDir,
+                                       self.origSrcDir, self.appName),
+         haltOnFailure=True,
+         description=['wget','deb'],
+        )
+
+    def doRepack(self):
+        self.addStep(ShellCommand,
+         name='repack_debs',
+         command=['sh','-c',
+                  WithProperties('make installers-%(locale)s deb-%(locale)s ' +
+                                 'DEB_BUILD_ARCH=armel ' +
+                                 'LOCALE_MERGEDIR=$PWD/merged')],
+         workdir='%s/%s/%s/locales' % (self.baseWorkDir, self.origSrcDir,
+                                       self.appName),
+         haltOnFailure=True,
+         description=['repack','deb'],
+        )
 
     def doUpload(self):
+        self.addStep(ShellCommand,
+         name='copy_deb',
+         command=['sh', '-c', WithProperties('if [ -f %(locale)s/*.deb ] ' +
+                  '; then cp -r %(locale)s ' + '%s/%s/dist ; fi' %
+                  (self.baseWorkDir, self.origSrcDir))],
+         workdir='%s/%s/%s/locales' % (self.baseWorkDir, self.origSrcDir,
+                                       self.appName),
+        )
         self.addUploadSteps(platform='linux')
 
 
 class MobileDesktopNightlyRepackFactory(MobileNightlyRepackFactory):
     def doUpload(self):
         self.addUploadSteps(platform=self.platform)