RHEL 5.1

rob myers rob.myers at gtri.gatech.edu
Thu Nov 8 21:35:50 UTC 2007


I know RHEL is a bit off topic for this list, but bear with me.  I
import all the RHEL5 bits into koji and then use koji to build rpms for
RHEL5.  The release of RHEL 5.1 gave me a few kinks to work out:

The RHEL5 supplementary channel includes some noarch packages which do
not come with source rpms.  This breaks the assumption in mash that
excludearch and exclusive arch can safely be initialized on SRPMS only.
I know that mash is not designed for this use case, but I thought it
might be worth pointing out.  The patch I used is below.

diff --git a/mash/__init__.py b/mash/__init__.py
index b02d6c8..6e7a496 100644
--- a/mash/__init__.py
+++ b/mash/__init__.py
@@ -209,6 +209,18 @@ class Mash:
         # now deal with noarch
         for pkg in noarch:
             for target_arch in self.config.arches:
+
+                # if excludearch is not set this build likely has no src.rpm
+                # so set excludearch and exclusivearch from the binary
+                if pkg['build_id'] fg
not in excludearch:
+                    path = os.path.join(koji.pathinfo.build(builds_hash[pkg['build_id']]), koji.pathinfo.rpm(pkg))
+                    fn = open(path, 'r')
+                    hdr = koji.get_rpm_header(fn)
+                    excludearch[pkg['build_id']] = hdr['EXCLUDEARCH']
+                    exclusivearch[pkg['build_id']] = hdr['EXCLUSIVEARCH']
+                    fn.close()
+                    continue
+
                 if (excludearch[pkg['build_id']] and has_any(masharch.compat[target_arch], excludearch[pkg['build_id']])) or \
                         (exclusivearch[pkg['build_id']] and not has_any(masharch.compat[target_arch], exclusivearch[pkg['build_id']])):
                     print "Excluding %s.%s from %s due to EXCLUDEARCH/EXCLUSIVEARCH" % (pkg['name'], pkg['arch'], target_arch)


Another problem was that I had already imported RHEL 5.1 beta, which has
the same rpms in RHEL 5.1 signed with a different key- one that I do not
have access to.  Since I wanted the rpms written out with the release
key, I added a function take the 5.1 release sighdrs and add them to the
previously imported RHEL 5.1 beta rpms. Would anyone else ever need this
functionality?  The patch I used is below.

diff --git a/hub/kojihub.py b/hub/kojihub.py
index f9ba39a..c5a1261 100644
--- a/hub/kojihub.py
+++ b/hub/kojihub.py
@@ -4706,6 +4706,15 @@ class RootExports(object):
         context.session.assertPerm('sign')
         return add_rpm_sig(an_rpm, base64.decodestring(data))
 
+    def addRPMSigByPath(self, an_rpm, path):
+        """Store a signature header for an rpm
+
+        an_rpm: N-V-R.a (for example)
+        path: the path to the signed rpm
+        """
+        context.session.assertPerm('sign')
+        return add_rpm_sig(an_rpm, koji.rip_rpm_sighdr(path))
+
     findBuildID = staticmethod(find_build_id)
     getTagID = staticmethod(get_tag_id)
     getTag = staticmethod(get_tag)


Comments?

rob.




More information about the Fedora-buildsys-list mailing list