[koji/f20] add some extra patches we need

Dennis Gilmore ausil at fedoraproject.org
Mon Aug 4 08:35:54 UTC 2014


commit 99dd5deeb560fbf42bc8f64c49f813e8d4303327
Author: Dennis Gilmore <dennis at ausil.us>
Date:   Mon Aug 4 03:35:44 2014 -0500

    add some extra patches we need

 0001-fix-distro-behavior-for-rhel-5.patch          |   28 ++++++++++
 0002-compress-docker-tarball-properly.patch        |   26 +++++++++
 0003-upload-the-tdl-priority-to-building.patch     |   54 ++++++++++++++++++++
 ...info-before-the-try-in-case-of-an-earlier.patch |   33 ++++++++++++
 0005-put-ova-options-in-its-own-section.patch      |   39 ++++++++++++++
 0006-use-offline-icicle-generation.patch           |   26 +++++++++
 0007-include-multilib-packages-in-repos.patch      |   44 ++++++++++++++++
 0008-bump-install-timeout-to-2-hours.patch         |   25 +++++++++
 koji.spec                                          |   22 +++++++--
 9 files changed, 293 insertions(+), 4 deletions(-)
---
diff --git a/0001-fix-distro-behavior-for-rhel-5.patch b/0001-fix-distro-behavior-for-rhel-5.patch
new file mode 100644
index 0000000..2eb869f
--- /dev/null
+++ b/0001-fix-distro-behavior-for-rhel-5.patch
@@ -0,0 +1,28 @@
+From 2e587154eb101ae4b2015a3b47bbb18e53d393dd Mon Sep 17 00:00:00 2001
+From: Jay Greguske <jgregusk at redhat.com>
+Date: Tue, 15 Apr 2014 14:31:10 -0400
+Subject: [PATCH 1/8] fix distro behavior for rhel 5
+
+---
+ builder/kojid | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/builder/kojid b/builder/kojid
+index 4163f49..1691a54 100755
+--- a/builder/kojid
++++ b/builder/kojid
+@@ -2654,7 +2654,10 @@ class OzImageTask(BaseTaskHandler):
+         image on.
+         """
+         if distro.startswith('RHEL'):
+-            return distro.split('.')
++            major, minor = distro.split('.')
++            if major == 'RHEL-5':
++                minor = 'U' + minor
++            return major, minor
+         elif distro.startswith('Fedora'):
+             return distro.split('-')
+         elif distro.startswith('CentOS'):
+-- 
+2.0.4
+
diff --git a/0002-compress-docker-tarball-properly.patch b/0002-compress-docker-tarball-properly.patch
new file mode 100644
index 0000000..2ce299e
--- /dev/null
+++ b/0002-compress-docker-tarball-properly.patch
@@ -0,0 +1,26 @@
+From 073bdb69e73e8943f3fb031f56b3d3ca66412edc Mon Sep 17 00:00:00 2001
+From: Jay Greguske <jgregusk at redhat.com>
+Date: Tue, 15 Apr 2014 14:45:40 -0400
+Subject: [PATCH 2/8] compress docker tarball properly
+
+---
+ builder/kojid | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/builder/kojid b/builder/kojid
+index 1691a54..cee7637 100755
+--- a/builder/kojid
++++ b/builder/kojid
+@@ -2824,7 +2824,8 @@ class BaseImageTask(OzImageTask):
+ 
+         # target-image type images
+         if 'docker' in self.formats:
+-            targ = do_target_image(base.base_image.identifier, 'docker')
++            targ = do_target_image(base.base_image.identifier, 'docker',
++                ova_opts={'compress': 'gzip'})
+             images['docker'] = {'image': targ.target_image.data}
+ 
+         ova_opts = {}
+-- 
+2.0.4
+
diff --git a/0003-upload-the-tdl-priority-to-building.patch b/0003-upload-the-tdl-priority-to-building.patch
new file mode 100644
index 0000000..70e2dd2
--- /dev/null
+++ b/0003-upload-the-tdl-priority-to-building.patch
@@ -0,0 +1,54 @@
+From b566eba6f83b151fcc058906a0630f4d9e303490 Mon Sep 17 00:00:00 2001
+From: Jay Greguske <jgregusk at redhat.com>
+Date: Wed, 16 Apr 2014 11:18:53 -0400
+Subject: [PATCH 3/8] upload the tdl priority to building
+
+---
+ builder/kojid | 14 +++++++-------
+ 1 file changed, 7 insertions(+), 7 deletions(-)
+
+diff --git a/builder/kojid b/builder/kojid
+index cee7637..32400c6 100755
+--- a/builder/kojid
++++ b/builder/kojid
+@@ -2813,13 +2813,7 @@ class BaseImageTask(OzImageTask):
+         lxml = self.fixImageXML('raw', imgname,
+             'libvirt-%s-%s.xml' % ('raw', arch),
+             base.base_image.parameters['libvirt_xml'])
+-        tdl_path = os.path.join(self.workdir, 'tdl-%s.xml' % arch)
+-        tdl = open(tdl_path, 'w')
+-        tdl.write(base.base_image.template)
+-        tdl.close()
+-        self.uploadFile(tdl_path)
+         images['raw'] = {'image': base.base_image.data, 'libvirt': lxml,
+-                         'tdl': os.path.basename(tdl_path),
+                          'icicle': base.base_image.icicle}
+ 
+         # target-image type images
+@@ -2889,6 +2883,12 @@ class BaseImageTask(OzImageTask):
+         self.logger.debug('IF config object: %s' % config)
+         ApplicationConfiguration(configuration=config)
+ 
++        tdl_path = os.path.join(self.workdir, 'tdl-%s.xml' % arch)
++        tdl = open(tdl_path, 'w')
++        tdl.write(template)
++        tdl.close()
++        self.uploadFile(tdl_path)
++
+         # ImageFactory picks a port to the guest VM using a rolling integer.
+         # This is a problem for concurrency, so we override the port it picks
+         # here using the task ID. (not a perfect solution but good enough:
+@@ -2900,9 +2900,9 @@ class BaseImageTask(OzImageTask):
+ 
+         # invoke the image builds
+         images = self.do_images(arch, template, ozlog, imgname)
++        images['raw']['tdl'] = os.path.basename(tdl_path),
+ 
+         # structure the results to pass back to the hub:
+-        tdl_path = images['raw']['tdl']
+         imgdata = {
+             'arch': arch,
+             'task_id': self.id,
+-- 
+2.0.4
+
diff --git a/0004-define-bld_info-before-the-try-in-case-of-an-earlier.patch b/0004-define-bld_info-before-the-try-in-case-of-an-earlier.patch
new file mode 100644
index 0000000..b3a279c
--- /dev/null
+++ b/0004-define-bld_info-before-the-try-in-case-of-an-earlier.patch
@@ -0,0 +1,33 @@
+From 7a1d6c4cd42f6efe8a3833a77a4475b6cfe9da43 Mon Sep 17 00:00:00 2001
+From: Jay Greguske <jgregusk at redhat.com>
+Date: Wed, 16 Apr 2014 12:00:33 -0400
+Subject: [PATCH 4/8] define bld_info before the try in case of an earlier
+ exception
+
+---
+ builder/kojid | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/builder/kojid b/builder/kojid
+index 32400c6..fa5daca 100755
+--- a/builder/kojid
++++ b/builder/kojid
+@@ -1824,6 +1824,7 @@ class BuildBaseImageTask(BuildImageTask):
+             raise koji.ApplianceError, 'ImageFactory functions not available'
+ 
+         # build image(s)
++        bld_info = None
+         try:
+             release = opts.get('release')
+             if not release:
+@@ -1832,7 +1833,6 @@ class BuildBaseImageTask(BuildImageTask):
+                 raise koji.ApplianceError('The Version may not have a hyphen')
+             if '-' in release:
+                 raise koji.ApplianceError('The Release may not have a hyphen')
+-            bld_info = None
+             if not opts.get('scratch'):
+                 bld_info = self.initImageBuild(name, version, release,
+                     target_info, opts)
+-- 
+2.0.4
+
diff --git a/0005-put-ova-options-in-its-own-section.patch b/0005-put-ova-options-in-its-own-section.patch
new file mode 100644
index 0000000..64f9e78
--- /dev/null
+++ b/0005-put-ova-options-in-its-own-section.patch
@@ -0,0 +1,39 @@
+From 20bb3e15265499d129cb85b6cd41a8724e037082 Mon Sep 17 00:00:00 2001
+From: Jay Greguske <jgregusk at redhat.com>
+Date: Wed, 16 Apr 2014 14:00:17 -0400
+Subject: [PATCH 5/8] put ova options in its own section
+
+---
+ cli/koji | 13 ++++++++-----
+ 1 file changed, 8 insertions(+), 5 deletions(-)
+
+diff --git a/cli/koji b/cli/koji
+index 088c505..504b4ba 100755
+--- a/cli/koji
++++ b/cli/koji
+@@ -5074,14 +5074,17 @@ def handle_image_build(options, session, args):
+             if config.has_option(section, arg):
+                 setattr(task_options, arg, config.get(section, arg).split(','))
+                 config.remove_option(section, arg)
+-        # ova_option is newline separated, handle that
+-        if config.has_option(section, 'ova_option'):
+-            task_options.ova_option = \
+-                config.get(section, 'ova_option').splitlines()
+-            config.remove_option(section, 'ova_option')
+         # handle everything else
+         for k, v in config.items(section):
+             setattr(task_options, k, v)
++
++        # ova-options belong in their own section
++        section = 'ova-options'
++        if config.has_section(section):
++            task_options.ova_option = []
++            for k, v in config.items(section):
++                task_options.ova_option.append('%s=%s' % (k, v))
++
+     else:
+         if len(args) < 5:
+             parser.error(_("At least five arguments are required: a name, " +
+-- 
+2.0.4
+
diff --git a/0006-use-offline-icicle-generation.patch b/0006-use-offline-icicle-generation.patch
new file mode 100644
index 0000000..10377e4
--- /dev/null
+++ b/0006-use-offline-icicle-generation.patch
@@ -0,0 +1,26 @@
+From 61c1737652544150fe962921b9dfd3708e1d256e Mon Sep 17 00:00:00 2001
+From: Jay Greguske <jgregusk at redhat.com>
+Date: Thu, 17 Apr 2014 18:59:41 -0400
+Subject: [PATCH 6/8] use offline icicle generation
+
+---
+ builder/kojid | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/builder/kojid b/builder/kojid
+index fa5daca..4712cc5 100755
+--- a/builder/kojid
++++ b/builder/kojid
+@@ -2787,7 +2787,8 @@ class BaseImageTask(OzImageTask):
+         tlog.setLevel(logging.DEBUG)
+         tlog.addHandler(fhandler)
+         images = {}
+-        params = {'install_script': str(self.ks.handler)} #ks contents
++        params = {'install_script': str(self.ks.handler),
++                  'offline_icicle': True}
+         random.seed() # necessary to ensure a unique mac address
+         try:
+             base = bd.builder_for_base_image(template, parameters=params)
+-- 
+2.0.4
+
diff --git a/0007-include-multilib-packages-in-repos.patch b/0007-include-multilib-packages-in-repos.patch
new file mode 100644
index 0000000..0603ff7
--- /dev/null
+++ b/0007-include-multilib-packages-in-repos.patch
@@ -0,0 +1,44 @@
+From 794abb71b1cd5662354475e2beafbab0f287b409 Mon Sep 17 00:00:00 2001
+From: Jay Greguske <jgregusk at redhat.com>
+Date: Thu, 17 Apr 2014 19:00:08 -0400
+Subject: [PATCH 7/8] include multilib packages in repos
+
+---
+ builder/mergerepos | 14 ++++++++++++++
+ 1 file changed, 14 insertions(+)
+
+diff --git a/builder/mergerepos b/builder/mergerepos
+index b873ccd..fecbc4b 100755
+--- a/builder/mergerepos
++++ b/builder/mergerepos
+@@ -48,6 +48,12 @@ EXPAND_ARCHES = {
+     'sh4': ['sh4a']
+     }
+ 
++MULTILIB_ARCHES = {
++    'x86_64': 'i386',
++    'ppc64': 'ppc',
++    's390x': 's390'
++    }
++
+ def parse_args(args):
+     """Parse our opts/args"""
+     usage = """
+@@ -78,6 +84,14 @@ def parse_args(args):
+         if EXPAND_ARCHES.has_key(arch):
+             opts.arches.extend(EXPAND_ARCHES[arch])
+ 
++    # support multilib repos
++    for arch in opts.arches[:]:
++        multilib_arch = MULTILIB_ARCHES.get(arch)
++        if multilib_arch:
++            opts.arches.append(multilib_arch)
++            if multilib_arch in EXPAND_ARCHES:
++                opts.arches.extend(EXPAND_ARCHES[multilib_arch])
++
+     # always include noarch
+     if not 'noarch' in opts.arches:
+         opts.arches.append('noarch')
+-- 
+2.0.4
+
diff --git a/0008-bump-install-timeout-to-2-hours.patch b/0008-bump-install-timeout-to-2-hours.patch
new file mode 100644
index 0000000..c4387cd
--- /dev/null
+++ b/0008-bump-install-timeout-to-2-hours.patch
@@ -0,0 +1,25 @@
+From 1fbbf825ab7962e68d0059ab86b0955312997035 Mon Sep 17 00:00:00 2001
+From: Jay Greguske <jgregusk at redhat.com>
+Date: Thu, 8 May 2014 11:34:51 -0400
+Subject: [PATCH 8/8] bump install timeout to 2 hours
+
+---
+ builder/kojid | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/builder/kojid b/builder/kojid
+index 4712cc5..90ff2bd 100755
+--- a/builder/kojid
++++ b/builder/kojid
+@@ -2608,7 +2608,7 @@ class OzImageTask(BaseTaskHandler):
+             'imgdir': os.path.join(self.workdir, 'scratch_images'),
+             'tmpdir': os.path.join(self.workdir, 'oz-tmp'),
+             'verbose' : True,
+-            'timeout': 3600,
++            'timeout': 7200,
+             'output': 'log',
+             'raw': False,
+             'debug': True,
+-- 
+2.0.4
+
diff --git a/koji.spec b/koji.spec
index f3ebd45..881768c 100644
--- a/koji.spec
+++ b/koji.spec
@@ -10,10 +10,17 @@ Group: Applications/System
 URL: http://fedorahosted.org/koji
 Patch0: fedora-config.patch
 Patch1: 0001-move-workdir-from-tmp-koji-to-var-tmp-koji.patch
-Patch2: compress-docker.patch
-Patch3: 0001-refactor-image-build-handlers-in-kojid.patch
-Patch4: 0002-refactor-do_images.patch
-Patch5: 0003-add-raw-xz-option.patch
+Patch2: 0001-fix-distro-behavior-for-rhel-5.patch
+Patch3: 0002-compress-docker-tarball-properly.patch
+Patch4: 0003-upload-the-tdl-priority-to-building.patch
+Patch5: 0004-define-bld_info-before-the-try-in-case-of-an-earlier.patch
+Patch6: 0005-put-ova-options-in-its-own-section.patch
+Patch7: 0006-use-offline-icicle-generation.patch
+Patch8: 0007-include-multilib-packages-in-repos.patch
+Patch9: 0008-bump-install-timeout-to-2-hours.patch
+Patch10: 0001-refactor-image-build-handlers-in-kojid.patch
+Patch11: 0002-refactor-do_images.patch
+Patch12: 0003-add-raw-xz-option.patch
 
 
 Source: https://fedorahosted.org/released/koji/koji-%{version}.tar.bz2
@@ -136,6 +143,13 @@ koji-web is a web UI to the Koji system.
 %patch3 -p1
 %patch4 -p1
 %patch5 -p1
+%patch6 -p1
+%patch7 -p1
+%patch8 -p1
+%patch9 -p1
+%patch10 -p1
+%patch11 -p1
+%patch12 -p1
 
 %build
 


More information about the scm-commits mailing list