remove unused setMozillaBuildProperties command slaves
authorDustin J. Mitchell <dustin@mozilla.com>
Tue, 15 Feb 2011 15:47:53 -0600
branchslaves
changeset 144 09249a3da5590933b41d01796afc2cb9e3cdc5f2
parent 143 17ee0ed21ca2f14f9ee1fad9386f515bf549fa21
child 145 2857fc5ff7612fac1453804067ed8413eccf7bc5
push id59
push userdmitchell@mozilla.com
push dateTue, 15 Feb 2011 21:49:58 +0000
remove unused setMozillaBuildProperties command
buildbot/slave/commands/mozilla.py
slave/buildslave/commands/mozilla.py
slave/buildslave/commands/registry.py
deleted file mode 100644
--- a/buildbot/slave/commands/mozilla.py
+++ /dev/null
@@ -1,139 +0,0 @@
-import os, platform, sha, sys
-from ConfigParser import ConfigParser
-from os import listdir, path
-from stat import ST_SIZE
-
-from buildbot.slave.commands.base import Command, command_version
-from buildbot.slave.commands.registry import registerSlaveCommand
-
-#### Mozilla Slave Commands
-class SetMozillaBuildProperties(Command):
-    def setup(self, args):
-        self.objdir = args['objdir']
-
-    def getPlatform(self):
-        # TODO: this should really be part of SlaveBuilder - or something
-        if platform.system() == "Linux":
-            return "linux"
-        elif platform.system() in ("Windows", "Microsoft"):
-            return "win32"
-        elif platform.system() == "Darwin":
-            return "macosx"
-
-    def getConfigSetting(self, file, section, setting):
-        try:
-            c = ConfigParser()
-            c.read([file])
-            return c.get(section, setting)
-        except:
-            return 'UNKNOWN'
-
-    def getFileHashAndSize(self, file):
-        sha1Hash = 'UNKNOWN'
-        size = 'UNKNOWN'
-
-        try:
-            # open in binary mode to make sure we get consistent results
-            # across all platforms
-            f = open(file, "rb")
-            shaObj = sha.new(f.read())
-            sha1Hash = shaObj.hexdigest()
-
-            size = os.stat(file)[ST_SIZE]
-        except:
-            pass
-
-        return (sha1Hash, size)
-
-    def start(self):
-        distDir = path.join(self.builder.builddir, self.objdir, 'dist')
-        appIni = path.join(distDir, 'bin', 'application.ini')
-        platformIni = path.join(distDir, 'bin', 'platform.ini')
-
-        buildid = 'UNKNOWN'
-        appVersion = 'UNKNOWN'
-        packageFilename = 'UNKNOWN'
-        packageHash = 'UNKNOWN'
-        packageSize = 'UNKNOWN'
-        installerFilename = 'UNKNOWN'
-        installerHash = 'UNKNOWN'
-        installerSize = 'UNKNOWN'
-        completeMarFilename = 'UNKNOWN'
-        completeMarHash = 'UNKNOWN'
-        completeMarSize = 'UNKNOWN'
-
-        # get the buildid and the app version
-        # use application.ini by default, fallback on platform.ini
-        if path.exists(appIni):
-            buildid = self.getConfigSetting(appIni, 'App', 'BuildID')
-            appVersion = self.getConfigSetting(appIni, 'App', 'Version')
-        elif path.exists(platformIni):
-            buildid = self.getConfigSetting(platformIni, 'Build', 'BuildID')
-            appVersion = self.getConfigSetting(platformIni, 'Build',
-              'Milestone')
-
-        # This is pretty simple, actually. It's simply searching the dist
-        # directory for the package.
-        try:
-            for entry in listdir(distDir):
-                if path.isfile(path.join(distDir, entry)):
-                    if self.getPlatform() == "linux":
-                        if entry.endswith('.tar.bz2'):
-                            packageFilename = entry
-                    elif self.getPlatform() == "macosx":
-                        if entry.endswith('.dmg'):
-                            packageFilename = entry
-                    elif self.getPlatform() == "win32":
-                        if entry.endswith('.zip'):
-                            packageFilename = entry
-        except:
-            pass
-
-        (packageHash, packageSize) = self.getFileHashAndSize(
-          path.join(distDir, packageFilename))
-
-        # for win32 only, get the filename/hash/size of the installer as well
-        if self.getPlatform() == "win32":
-            try:
-                for entry in listdir(path.join(distDir, 'install', 'sea')):
-                    if path.isfile(path.join(distDir, 'install', 'sea', entry)):
-                        if entry.endswith('.exe'):
-                            installerFilename = entry
-            except:
-                pass
-
-        (installerHash, installerSize) = self.getFileHashAndSize(
-          path.join(distDir, 'install', 'sea', installerFilename))
-
-
-        # gather the filename/hash/size of the complete update
-        try:
-            for entry in listdir(path.join(distDir, 'update')):
-                if path.isfile(path.join(distDir, 'update', entry)):
-                    if entry.endswith('complete.mar'):
-                        completeMarFilename = entry
-        except:
-            pass
-
-        (completeMarHash, completeMarSize) = self.getFileHashAndSize(
-          path.join(distDir, 'update', completeMarFilename))
-
-        # we can't set build properties from here so we'll add them to a log
-        # and evaluateCommand() will take care of setting them
-        log = "buildid: %s\n" % buildid
-        log += "appVersion: %s\n" % appVersion
-        log += "packageFilename: %s\n" % packageFilename
-        log += "packageHash: %s\n" % packageHash
-        log += "packageSize: %s\n" % packageSize
-        log += "installerFilename: %s\n" % installerFilename
-        log += "installerHash: %s\n" % installerHash
-        log += "installerSize: %s\n" % installerSize
-        log += "completeMarFilename: %s\n" % completeMarFilename
-        log += "completeMarHash: %s\n" % completeMarHash
-        log += "completeMarSize: %s" % completeMarSize
-
-        self.sendStatus({'stdout': log})
-
-
-registerSlaveCommand("setMozillaBuildProperties",
-  SetMozillaBuildProperties, command_version)
deleted file mode 100644
--- a/slave/buildslave/commands/mozilla.py
+++ /dev/null
@@ -1,135 +0,0 @@
-import os, platform, sha, sys
-from ConfigParser import ConfigParser
-from os import listdir, path
-from stat import ST_SIZE
-
-from buildbot.slave.commands.base import Command, command_version
-
-#### Mozilla Slave Commands
-class SetMozillaBuildProperties(Command):
-    def setup(self, args):
-        self.objdir = args['objdir']
-
-    def getPlatform(self):
-        # TODO: this should really be part of SlaveBuilder - or something
-        if platform.system() == "Linux":
-            return "linux"
-        elif platform.system() in ("Windows", "Microsoft"):
-            return "win32"
-        elif platform.system() == "Darwin":
-            return "macosx"
-
-    def getConfigSetting(self, file, section, setting):
-        try:
-            c = ConfigParser()
-            c.read([file])
-            return c.get(section, setting)
-        except:
-            return 'UNKNOWN'
-
-    def getFileHashAndSize(self, file):
-        sha1Hash = 'UNKNOWN'
-        size = 'UNKNOWN'
-
-        try:
-            # open in binary mode to make sure we get consistent results
-            # across all platforms
-            f = open(file, "rb")
-            shaObj = sha.new(f.read())
-            sha1Hash = shaObj.hexdigest()
-
-            size = os.stat(file)[ST_SIZE]
-        except:
-            pass
-
-        return (sha1Hash, size)
-
-    def start(self):
-        distDir = path.join(self.builder.builddir, self.objdir, 'dist')
-        appIni = path.join(distDir, 'bin', 'application.ini')
-        platformIni = path.join(distDir, 'bin', 'platform.ini')
-
-        buildid = 'UNKNOWN'
-        appVersion = 'UNKNOWN'
-        packageFilename = 'UNKNOWN'
-        packageHash = 'UNKNOWN'
-        packageSize = 'UNKNOWN'
-        installerFilename = 'UNKNOWN'
-        installerHash = 'UNKNOWN'
-        installerSize = 'UNKNOWN'
-        completeMarFilename = 'UNKNOWN'
-        completeMarHash = 'UNKNOWN'
-        completeMarSize = 'UNKNOWN'
-
-        # get the buildid and the app version
-        # use application.ini by default, fallback on platform.ini
-        if path.exists(appIni):
-            buildid = self.getConfigSetting(appIni, 'App', 'BuildID')
-            appVersion = self.getConfigSetting(appIni, 'App', 'Version')
-        elif path.exists(platformIni):
-            buildid = self.getConfigSetting(platformIni, 'Build', 'BuildID')
-            appVersion = self.getConfigSetting(platformIni, 'Build',
-              'Milestone')
-
-        # This is pretty simple, actually. It's simply searching the dist
-        # directory for the package.
-        try:
-            for entry in listdir(distDir):
-                if path.isfile(path.join(distDir, entry)):
-                    if self.getPlatform() == "linux":
-                        if entry.endswith('.tar.bz2'):
-                            packageFilename = entry
-                    elif self.getPlatform() == "macosx":
-                        if entry.endswith('.dmg'):
-                            packageFilename = entry
-                    elif self.getPlatform() == "win32":
-                        if entry.endswith('.zip'):
-                            packageFilename = entry
-        except:
-            pass
-
-        (packageHash, packageSize) = self.getFileHashAndSize(
-          path.join(distDir, packageFilename))
-
-        # for win32 only, get the filename/hash/size of the installer as well
-        if self.getPlatform() == "win32":
-            try:
-                for entry in listdir(path.join(distDir, 'install', 'sea')):
-                    if path.isfile(path.join(distDir, 'install', 'sea', entry)):
-                        if entry.endswith('.exe'):
-                            installerFilename = entry
-            except:
-                pass
-
-        (installerHash, installerSize) = self.getFileHashAndSize(
-          path.join(distDir, 'install', 'sea', installerFilename))
-
-
-        # gather the filename/hash/size of the complete update
-        try:
-            for entry in listdir(path.join(distDir, 'update')):
-                if path.isfile(path.join(distDir, 'update', entry)):
-                    if entry.endswith('complete.mar'):
-                        completeMarFilename = entry
-        except:
-            pass
-
-        (completeMarHash, completeMarSize) = self.getFileHashAndSize(
-          path.join(distDir, 'update', completeMarFilename))
-
-        # we can't set build properties from here so we'll add them to a log
-        # and evaluateCommand() will take care of setting them
-        log = "buildid: %s\n" % buildid
-        log += "appVersion: %s\n" % appVersion
-        log += "packageFilename: %s\n" % packageFilename
-        log += "packageHash: %s\n" % packageHash
-        log += "packageSize: %s\n" % packageSize
-        log += "installerFilename: %s\n" % installerFilename
-        log += "installerHash: %s\n" % installerHash
-        log += "installerSize: %s\n" % installerSize
-        log += "completeMarFilename: %s\n" % completeMarFilename
-        log += "completeMarHash: %s\n" % completeMarHash
-        log += "completeMarSize: %s" % completeMarSize
-
-        self.sendStatus({'stdout': log})
-
--- a/slave/buildslave/commands/registry.py
+++ b/slave/buildslave/commands/registry.py
@@ -12,18 +12,16 @@
 # Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 #
 # Copyright Buildbot Team Members
 
 from twisted.python import reflect
 
 commandRegistry = {
     # command name : fully qualified factory name (callable)
-    "setMozillaBuildProperties" : "buildslave.commands.mozilla.SetMozillaBuildProperties",
-
     "shell" : "buildslave.commands.shell.SlaveShellCommand",
     "uploadFile" : "buildslave.commands.transfer.SlaveFileUploadCommand",
     "uploadDirectory" : "buildslave.commands.transfer.SlaveDirectoryUploadCommand",
     "downloadFile" : "buildslave.commands.transfer.SlaveFileDownloadCommand",
     "svn" : "buildslave.commands.svn.SVN",
     "bk" : "buildslave.commands.bk.BK",
     "cvs" : "buildslave.commands.cvs.CVS",
     "darcs" : "buildslave.commands.darcs.Darcs",