summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnas Nashif <anas.nashif@intel.com>2012-04-22 22:04:21 +0100
committerAnas Nashif <anas.nashif@intel.com>2012-04-22 22:04:21 +0100
commitd18ea64052a07ede585ad046ac2fccf0e1fdd31b (patch)
treeb8bca76a0012fe6af007d44b29eed0cea7828338
parent634690eefa6f10f91b3c89d5571cb8ed6fd72cf3 (diff)
downloadkickstarter-d18ea64052a07ede585ad046ac2fccf0e1fdd31b.tar.gz
kickstarter-d18ea64052a07ede585ad046ac2fccf0e1fdd31b.tar.bz2
kickstarter-d18ea64052a07ede585ad046ac2fccf0e1fdd31b.zip
create individual ks files
create individual ks files and add support for returning list of packages and groups to be installed
-rw-r--r--TODO1
-rwxr-xr-xtools/kickstarter36
2 files changed, 28 insertions, 9 deletions
diff --git a/TODO b/TODO
index 0442912..890dead 100644
--- a/TODO
+++ b/TODO
@@ -1,4 +1,3 @@
-
List of things to do:
- Add support for build IDs (partially done)
diff --git a/tools/kickstarter b/tools/kickstarter
index dd71b70..1ec2790 100755
--- a/tools/kickstarter
+++ b/tools/kickstarter
@@ -190,6 +190,10 @@ if __name__ == '__main__':
help="repo meta file")
parser.add_option("-i", "--index", type="string", dest="indexfile",
help="generate index file")
+ parser.add_option("-C", "--config", type="string", dest="config", default=None,
+ help="Limit to this configuration file")
+ parser.add_option("-p", "--packages", action="store_true", dest="packages", default=False,
+ help="return list of packages to be installed for this configuration")
(options, args) = parser.parse_args()
@@ -211,22 +215,38 @@ if __name__ == '__main__':
if image_meta.has_key('Configurations'):
for img in image_meta['Configurations']:
conf = ks.parse(img)
- if conf.has_key('Active') and conf['Active']:
- print "Creating %s (%s.ks)" %(img['Name'], img['FileName'] )
- ks.process_files(conf, r)
+ if options.config:
+ if img.has_key('FileName') and options.config == img['FileName']:
+ print "Creating %s (%s.ks)" %(img['Name'], img['FileName'] )
+ ks.process_files(conf, r)
+ break
else:
- print "%s is inactive, not generate %s this time" %(img['Name'], img['FileName'] )
+ if conf.has_key('Active') and conf['Active'] :
+ print "Creating %s (%s.ks)" %(img['Name'], img['FileName'] )
+ ks.process_files(conf, r)
+ else:
+ print "%s is inactive, not generating %s at this time" %(img['Name'], img['FileName'] )
for path in image_meta['ExternalConfigs']:
for f in os.listdir(path):
if f.endswith('.yaml'):
fp = file('%s/%s' %(path, f), 'r')
local = yaml.load(fp)
conf = ks.parse(local)
- if conf.has_key('Active') and conf['Active']:
- print "Creating %s (%s.ks)" %(conf['Name'], conf['FileName'] )
- ks.process_files(conf, r)
+ if options.config:
+ if options.config == conf['FileName']:
+ if options.packages:
+ print conf['Groups']
+ print conf['ExtraPackages']
+ else:
+ print "Creating %s (%s.ks)" %(conf['Name'], conf['FileName'] )
+ ks.process_files(conf, r)
+ break
else:
- print "%s is inactive, not generate %s this time" %(conf['Name'], conf['FileName'] )
+ if conf.has_key('Active') and conf['Active']:
+ print "Creating %s (%s.ks)" %(conf['Name'], conf['FileName'] )
+ ks.process_files(conf, r)
+ else:
+ print "%s is inactive, not generate %s this time" %(conf['Name'], conf['FileName'] )
else:
print "WARNING: File '%s' ignored." % (f)