diff options
author | Joshua Harlow <harlowja@yahoo-inc.com> | 2012-09-25 13:19:36 -0700 |
---|---|---|
committer | Joshua Harlow <harlowja@yahoo-inc.com> | 2012-09-25 13:19:36 -0700 |
commit | 4e36bf2225d2b6e7a7ac1821e1d00ac72abb5856 (patch) | |
tree | 7e572fd11abcae51748f6c581a9f6bcc2c4f84d2 /packages | |
parent | 67e7d9c0280c3204cf503113d9dca769399eefc9 (diff) | |
download | vyos-cloud-init-4e36bf2225d2b6e7a7ac1821e1d00ac72abb5856.tar.gz vyos-cloud-init-4e36bf2225d2b6e7a7ac1821e1d00ac72abb5856.zip |
Add the ability to pass patches to the
rpm builder utility.
Diffstat (limited to 'packages')
-rwxr-xr-x | packages/brpm | 7 | ||||
-rw-r--r-- | packages/redhat/cloud-init.spec.in | 7 |
2 files changed, 14 insertions, 0 deletions
diff --git a/packages/brpm b/packages/brpm index 77de0cf2..616ae021 100755 --- a/packages/brpm +++ b/packages/brpm @@ -149,6 +149,7 @@ def generate_spec_contents(args, tmpl_fn, arc_fn): 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 @@ def main(): " (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 @@ def main(): 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)) diff --git a/packages/redhat/cloud-init.spec.in b/packages/redhat/cloud-init.spec.in index 35b27beb..6604b1ac 100644 --- a/packages/redhat/cloud-init.spec.in +++ b/packages/redhat/cloud-init.spec.in @@ -36,6 +36,13 @@ Requires: shadow-utils 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 |