add --extra-packs option for gbs build, implement # 119
authorZhang Qiang <qiang.z.zhang@intel.com>
Fri, 6 Jul 2012 08:54:58 +0000 (16:54 +0800)
committerZhang Qiang <qiang.z.zhang@intel.com>
Sat, 7 Jul 2012 06:23:58 +0000 (14:23 +0800)
This option can be used to install more extra packages in build root.
for example, developer can add option `--extra-packs=zypper,vim` to
install extra zypper and vim to final build root.

gitbuildsys/cmd_build.py
tools/gbs

index 438fb8e..dfbee7a 100644 (file)
@@ -364,6 +364,10 @@ def do(opts, args):
     if opts.ccache:
         cmd += ['--ccache']
 
+    if opts.extra_packs:
+        extrapkgs = opts.extra_packs.split(',')
+        cmd += ['--extra-packs=%s' % ' '.join(extrapkgs)]
+
     if hostarch != buildarch and buildarch in change_personality:
         cmd = [ change_personality[buildarch] ] + cmd
 
index 54139a5..0ac8fc3 100755 (executable)
--- a/tools/gbs
+++ b/tools/gbs
@@ -195,6 +195,11 @@ class Gbs(cmdln.Cmdln):
                   default=None,
                   dest='spec',
                   help='Specify a spec file to use')
+    @cmdln.option('--extra-packs',
+                  default=None,
+                  dest='extra_packs',
+                  help='Specify extra packages to install to build root '\
+                       'multiple packages can be separated by comma')
     @cmdln.option('--debuginfo',
                   action='store_true',
                   default=False,