← Back to team overview

cloud-init-dev team mailing list archive

[Merge] lp:~harlowja/cloud-init/rpm-patch-inputs into lp:cloud-init

 

Joshua Harlow has proposed merging lp:~harlowja/cloud-init/rpm-patch-inputs into lp:cloud-init.

Requested reviews:
  cloud init development team (cloud-init-dev)

For more details, see:
https://code.launchpad.net/~harlowja/cloud-init/rpm-patch-inputs/+merge/126342

Allow the brpm package to be ran with a set of patch files to include when building.
-- 
https://code.launchpad.net/~harlowja/cloud-init/rpm-patch-inputs/+merge/126342
Your team cloud init development team is requested to review the proposed merge of lp:~harlowja/cloud-init/rpm-patch-inputs into lp:cloud-init.
=== modified file 'cloudinit/distros/__init__.py'
--- cloudinit/distros/__init__.py	2012-09-25 00:17:10 +0000
+++ cloudinit/distros/__init__.py	2012-09-25 22:11:22 +0000
@@ -112,7 +112,7 @@
         return arch
 
     def _get_arch_package_mirror_info(self, arch=None):
-        mirror_info = self.get_option("package_mirrors", None)
+        mirror_info = self.get_option("package_mirrors") or []
         if arch == None:
             arch = self.get_primary_arch()
         return _get_arch_package_mirror_info(mirror_info, arch)
@@ -122,7 +122,6 @@
         # this resolves the package_mirrors config option
         # down to a single dict of {mirror_name: mirror_url}
         arch_info = self._get_arch_package_mirror_info(arch)
-
         return _get_package_mirror_info(availability_zone=availability_zone,
                                         mirror_info=arch_info)
 

=== modified file 'packages/brpm'
--- packages/brpm	2012-07-09 20:41:45 +0000
+++ packages/brpm	2012-09-25 22:11:22 +0000
@@ -149,6 +149,7 @@
         subs['systemd'] = False
 
     subs['init_sys'] = args.boot
+    subs['patches'] = [os.path.basename(p) for p in args.patches]
     return templater.render_from_file(tmpl_fn, params=subs)
 
 
@@ -164,6 +165,10 @@
                               " (default: %(default)s)"),
                         default=False,
                         action='store_true')
+    parser.add_argument("-p", "--patch", dest="patches",
+                        help=("include the following patch when building"),
+                        default=[],
+                        action='append')
     args = parser.parse_args()
     capture = True
     if args.verbose:
@@ -197,6 +202,8 @@
     spec_fn = util.abs_join(root_dir, 'cloud-init.spec')
     util.write_file(spec_fn, contents)
     print("Created spec file at %r" % (spec_fn))
+    for p in args.patches:
+        util.copy(p, util.abs_join(arc_dir, os.path.basename(p)))
 
     # Now build it!
     print("Running 'rpmbuild' in %r" % (root_dir))

=== modified file 'packages/redhat/cloud-init.spec.in'
--- packages/redhat/cloud-init.spec.in	2012-07-09 21:09:04 +0000
+++ packages/redhat/cloud-init.spec.in	2012-09-25 22:11:22 +0000
@@ -36,6 +36,13 @@
 Requires:       ${r}
 #end for
 
+# Custom patches
+#set $size = 0
+#for $p in $patches
+Patch${size}: $p
+#set $size += 1
+#end for
+
 #if $sysvinit
 Requires(post):       chkconfig
 Requires(postun):     initscripts


Follow ups