Update of /cvsroot/fink/dists/10.4/unstable/main/finkinfo/devel
In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv26093

Modified Files:
        buildbot-py.info 
Added Files:
        buildbot-py.patch 
Log Message:
Patches from buildbot's git repository to allow test suite to succeed (adds in
a few missing files).

However, Twisted 8.2.0-1 makes one other test fail, and introduces a whole lot
of warnings. Stay tuned...


--- NEW FILE: buildbot-py.patch ---
diff --git a/NEWS b/NEWS
index d585301..a868ee7 100644
--- a/NEWS
+++ b/NEWS
@@ -91,7 +91,7 @@ Passwords are suitably obfuscated in logfiles.
 This step uploads an entire directory to the master, and can be useful when a
 build creates several products (e.g., a client and server package).
 
-*** MasterShelCommand
+*** MasterShellCommand
 
 This step runs a shell command on the server, and can be useful for
 post-processing build products, or performing other maintenance tasks on the
diff --git a/buildbot/status/words.py b/buildbot/status/words.py
index ab892d7..0e98651 100644
--- a/buildbot/status/words.py
+++ b/buildbot/status/words.py
@@ -277,6 +277,10 @@ class Contact:
     def builderChangedState(self, builderName, state):
         log.msg('[Contact] Builder %s changed state to %s' % (builderName, 
state))
 
+    def requestSubmitted(self, brstatus):
+        log.msg('[Contact] BuildRequest for %s submiitted to Builder %s' % 
+            (brstatus.getSourceStamp(), brstatus.builderName))
+
     def builderRemoved(self, builderName):
         log.msg('[Contact] Builder %s removed' % (builderName))
 
diff --git a/setup.py b/setup.py
index 1a744cd..451f15f 100644
--- a/setup.py
+++ b/setup.py
@@ -84,6 +84,8 @@ setup_args = {
               "buildbot.status", "buildbot.status.web",
               "buildbot.changes",
               "buildbot.steps",
+              "buildbot.steps.package",
+              "buildbot.steps.package.rpm",
               "buildbot.process",
               "buildbot.clients",
               "buildbot.slave",
diff --git a/buildbot/steps/package/__init__.py 
b/buildbot/steps/package/__init__.py
new file mode 100644
index 0000000..d81f066
--- /dev/null
+++ b/buildbot/steps/package/__init__.py
@@ -0,0 +1,11 @@
+# Steve 'Ashcrow' Milner <smilner+build...@redhat.com>
+#
+# This software may be freely redistributed under the terms of the GNU
+# general public license.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+"""
+Steps specific to package formats.
+"""
diff --git a/buildbot/steps/package/rpm/__init__.py 
b/buildbot/steps/package/rpm/__init__.py
new file mode 100644
index 0000000..0d7be6d
--- /dev/null
+++ b/buildbot/steps/package/rpm/__init__.py
@@ -0,0 +1,15 @@
+# Steve 'Ashcrow' Milner <smilner+build...@redhat.com>
+#
+# This software may be freely redistributed under the terms of the GNU
+# general public license.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+"""
+Steps specific to the rpm format.
+"""
+
+from rpmbuild import RpmBuild
+from rpmspec import RpmSpec
+from rpmlint import RpmLint
diff --git a/buildbot/steps/package/rpm/rpmbuild.py 
b/buildbot/steps/package/rpm/rpmbuild.py
new file mode 100644
index 0000000..6f30145
--- /dev/null
+++ b/buildbot/steps/package/rpm/rpmbuild.py
@@ -0,0 +1,143 @@
+# Dan Radez <dradez+build...@redhat.com>
+# Steve 'Ashcrow' Milner <smilner+build...@redhat.com>
+#
+# This software may be freely redistributed under the terms of the GNU
+# general public license.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+"""
+RPM Building steps.
+"""
+
+from buildbot.steps.shell import ShellCommand
+from buildbot.process.buildstep import RemoteShellCommand
+
+
+class RpmBuild(ShellCommand):
+    """
+    Build and RPM based on pased spec filename
+    """
+
+    import os.path
+
+    name = "rpmbuilder"
+    haltOnFailure = 1
+    description = ["RPMBUILD"]
+    descriptionDone = ["RPMBUILD"]
+
+    def __init__(self,
+                 specfile=None,
+                 topdir='`pwd`',
+                 builddir='`pwd`',
+                 rpmdir='`pwd`',
+                 sourcedir='`pwd`',
+                 specdir='`pwd`',
+                 srcrpmdir='`pwd`',
+                 dist='.el5',
+                 autoRelease=False,
+                 vcsRevision=False,
+                 **kwargs):
+        """
+        Creates the RpmBuild object.
+
+        @type specfile: str
+        @param specfile: the name of the spec file for the rpmbuild
+        @type topdir: str
+        @param topdir: the top directory for rpm building.
+        @type builddir: str
+        @param builddir: the directory to use for building
+        @type rpmdir: str
+        @param rpmdir: the directory to dump the rpms into
+        @type sourcedir: str
+        @param sourcedir: the directory that houses source code
+        @type srcrpmdir: str
+        @param srcrpmdir: the directory to dump source rpms into
+        @type dist: str
+        @param dist: the distribution to build for
+        @type autoRelease: boolean
+        @param autoRelease: if the auto release mechanics should be used
+        @type vcsRevision: boolean
+        @param vcsRevision: if the vcs revision mechanics should be used
+        @type kwargs: dict
+        @param kwargs: All further keyword arguments.
+        """
+        ShellCommand.__init__(self, **kwargs)
+        self.addFactoryArguments(topdir=topdir,
+                                 builddir=builddir,
+                                 rpmdir=rpmdir,
+                                 sourcedir=sourcedir,
+                                 specdir=specdir,
+                                 srcrpmdir=srcrpmdir,
+                                 specfile=specfile,
+                                 dist=dist,
+                                 autoRelease=autoRelease,
+                                 vcsRevision=vcsRevision)
+        self.rpmbuild = (
+            'rpmbuild --define "_topdir %s" --define "_builddir %s"'
+            ' --define "_rpmdir %s" --define "_sourcedir %s"'
+            ' --define "_specdir %s" --define "_srcrpmdir %s"'
+            ' --define "dist %s"' % (topdir, builddir, rpmdir, sourcedir,
+            specdir, srcrpmdir, dist))
+        self.specfile = specfile
+        self.autoRelease = autoRelease
+        self.vcsRevision = vcsRevision
+
+    def start(self):
+        """
+        Buildbot Calls Me when it's time to start
+        """
+        if self.autoRelease:
+            relfile = '%s.release' % (
+                self.os.path.basename(self.specfile).split('.')[0])
+            try:
+                rfile = open(relfile, 'r')
+                rel = int(rfile.readline().strip())
+                rfile.close()
+            except:
+                rel = 0
+            self.rpmbuild = self.rpmbuild + ' --define "_release %s"' % rel
+            rfile = open(relfile, 'w')
+            rfile.write(str(rel+1))
+            rfile.close()
+
+        if self.vcsRevision:
+            self.rpmbuild = self.rpmbuild + ' --define "_revision %s"' % \
+                self.getProperty('got_revision')
+
+        self.rpmbuild = self.rpmbuild + ' -ba %s' % self.specfile
+
+        self.command = ['bash', '-c', self.rpmbuild]
+
+        # create the actual RemoteShellCommand instance now
+        kwargs = self.remote_kwargs
+        kwargs['command'] = self.command
+        cmd = RemoteShellCommand(**kwargs)
+        self.setupEnvironment(cmd)
+        self.checkForOldSlaveAndLogfiles()
+        self.startCommand(cmd)
+
+    def createSummary(self, log):
+        """
+        Create nice summary logs.
+
+        @param log: The log to create summary off of.
+        """
+        rpm_prefixes = ['Provides:', 'Requires(rpmlib):', 'Requires:',
+                        'Checking for unpackaged', 'Wrote:',
+                        'Executing(%', '+ ']
+        rpm_err_pfx = ['   ', 'RPM build errors:', 'error: ']
+
+        rpmcmdlog = []
+        rpmerrors = []
+
+        for line in log.readlines():
+            for pfx in rpm_prefixes:
+                if pfx in line:
+                    rpmcmdlog.append(line)
+            for err in rpm_err_pfx:
+                if err in line:
+                    rpmerrors.append(line)
+        self.addCompleteLog('RPM Command Log', "".join(rpmcmdlog))
+        self.addCompleteLog('RPM Errors', "".join(rpmerrors))
diff --git a/buildbot/steps/package/rpm/rpmlint.py 
b/buildbot/steps/package/rpm/rpmlint.py
new file mode 100644
index 0000000..444a44a
--- /dev/null
+++ b/buildbot/steps/package/rpm/rpmlint.py
@@ -0,0 +1,51 @@
+# Steve 'Ashcrow' Milner <smilner+build...@redhat.com>
+#
+# This software may be freely redistributed under the terms of the GNU
+# general public license.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+"""
+Steps and objects related to rpmlint.
+"""
+
+from buildbot.steps.shell import Test
+
+
+class RpmLint(Test):
+    """
+    Rpmlint build step.
+    """
+
+    description = ["Checking for RPM/SPEC issues"]
+    descriptionDone = ["Finished checking RPM/SPEC issues"]
+
+    def __init__(self, fileloc="*rpm", **kwargs):
+        """
+        Create the Rpmlint object.
+
+        @type fileloc: str
+        @param fileloc: Location glob of the specs or rpms.
+        @type kwargs: dict
+        @param fileloc: all other keyword arguments.
+        """
+        Test.__init__(self, **kwargs)
+        self.command = ["/usr/bin/rpmlint", "-i"]
+        self.command.append(fileloc)
+
+    def createSummary(self, log):
+        """
+        Create nice summary logs.
+
+        @param log: log to create summary off of.
+        """
+        warnings = []
+        errors = []
+        for line in log.readlines():
+            if ' W: ' in line:
+                warnings.append(line)
+            elif ' E: ' in line:
+                errors.append(line)
+        self.addCompleteLog('Rpmlint Warnings', "".join(warnings))
+        self.addCompleteLog('Rpmlint Errors', "".join(errors))
diff --git a/buildbot/steps/package/rpm/rpmspec.py 
b/buildbot/steps/package/rpm/rpmspec.py
new file mode 100644
index 0000000..6aa5254
--- /dev/null
+++ b/buildbot/steps/package/rpm/rpmspec.py
@@ -0,0 +1,67 @@
+# Dan Radez <dradez+build...@redhat.com>
+# Steve 'Ashcrow' Milner <smilner+build...@redhat.com>
+#
+# This software may be freely redistributed under the terms of the GNU
+# general public license.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+"""
+library to populate parameters from and rpmspec file into a memory structure
+"""
+
+
+from buildbot.steps.shell import ShellCommand
+
+
+class RpmSpec(ShellCommand):
+    """
+    read parameters out of an rpm spec file
+    """
+
+    import re
+    import types
+
+    #initialize spec info vars and get them from the spec file
+    n_regex = re.compile('^Name:[ ]*([^\s]*)')
+    v_regex = re.compile('^Version:[ ]*([0-9\.]*)')
+
+    def __init__(self, specfile=None, **kwargs):
+        """
+        Creates the RpmSpec object.
+
+        @type specfile: str
+        @param specfile: the name of the specfile to get the package
+            name and version from
+        @type kwargs: dict
+        @param kwargs: All further keyword arguments.
+        """
+        self.specfile = specfile
+        self._pkg_name = None
+        self._pkg_version = None
+        self._loaded = False
+
+    def load(self):
+        """
+        call this function after the file exists to populate properties
+        """
+        # If we are given a string, open it up else assume it's something we
+        # can call read on.
+        if type(self.specfile) == self.types.StringType:
+            f = open(self.specfile, 'r')
+        else:
+            f = self.specfile
+
+        for line in f:
+            if self.v_regex.match(line):
+                self._pkg_version = self.v_regex.match(line).group(1)
+            if self.n_regex.match(line):
+                self._pkg_name = self.n_regex.match(line).group(1)
+        f.close()
+        self._loaded = True
+
+    # Read-only properties
+    loaded = property(lambda self: self._loaded)
+    pkg_name = property(lambda self: self._pkg_name)
+    pkg_version = property(lambda self: self._pkg_version)

Index: buildbot-py.info
===================================================================
RCS file: 
/cvsroot/fink/dists/10.4/unstable/main/finkinfo/devel/buildbot-py.info,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- buildbot-py.info    27 Feb 2009 02:22:09 -0000      1.9
+++ buildbot-py.info    2 Mar 2009 18:04:47 -0000       1.10
@@ -2,14 +2,21 @@
 Package: buildbot-py%type_pkg[python]
 Type: python (2.3 2.4 2.5)
 Version: 0.7.10
-Revision: 1
+Revision: 2
 Distribution: (%type_pkg[python] = 23) 10.3, (%type_pkg[python] = 23) 10.4
 
 Depends: python%type_pkg[python], twisted2-py%type_pkg[python],  
twisted2-mail-py%type_pkg[python],  twisted2-web-py%type_pkg[python],  
twisted2-words-py%type_pkg[python]
 
+# For patchfile:
+BuildDepends: fink (>= 0.24.12)
+
 Source: mirror:sourceforge:buildbot/buildbot-%v.tar.gz
 Source-MD5: 3a51f6ba8a852382863d1940cef89a46
 
+# Add files needed for successful completion of tests.
+PatchFile: buildbot-py.patch
+PatchFile-MD5: 329efec85ea4639fd70047cda46346bd
+
 DocFiles: CREDITS NEWS README PKG-INFO
 
 CompileScript: <<


------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Fink-commits mailing list
Fink-commits@lists.sourceforge.net
http://news.gmane.org/gmane.os.apple.fink.cvs

Reply via email to