summaryrefslogtreecommitdiff
path: root/plugins/imager
diff options
context:
space:
mode:
authorJF Ding <jian-feng.ding@intel.com>2011-09-12 08:36:17 -0700
committerJF Ding <jian-feng.ding@intel.com>2011-09-12 08:36:17 -0700
commitfcd4286c11240366410191b2d1adef595149a153 (patch)
tree5a4b219a0630109126dabf7bd9e65f0052d45112 /plugins/imager
parentab2993992edcc0fc66c55f2c8c101a1c4ab77dfb (diff)
downloadmic-fcd4286c11240366410191b2d1adef595149a153.tar.gz
mic-fcd4286c11240366410191b2d1adef595149a153.tar.bz2
mic-fcd4286c11240366410191b2d1adef595149a153.zip
add --release support for new imagetype
Diffstat (limited to 'plugins/imager')
-rw-r--r--plugins/imager/fs_plugin.py2
-rw-r--r--plugins/imager/slp_plugin.py17
2 files changed, 17 insertions, 2 deletions
diff --git a/plugins/imager/fs_plugin.py b/plugins/imager/fs_plugin.py
index 395c2ce..597076a 100644
--- a/plugins/imager/fs_plugin.py
+++ b/plugins/imager/fs_plugin.py
@@ -96,7 +96,7 @@ class FsPlugin(ImagerPlugin):
creator.package(destdir)
outimage = creator.outimage
if createopts['release'] is not None:
- misc.create_release(ksconf, creatoropts['outdir'], creatoropts['name'], outimage, creatoropts['release'])
+ misc.create_release(ksconf, createopts['outdir'], createopts['name'], outimage, createopts['release'])
creator.print_outimage_info()
except errors.CreatorError:
raise
diff --git a/plugins/imager/slp_plugin.py b/plugins/imager/slp_plugin.py
index 738b8c9..4812e3e 100644
--- a/plugins/imager/slp_plugin.py
+++ b/plugins/imager/slp_plugin.py
@@ -43,7 +43,15 @@ class SLPlugin(ImagerPlugin):
cfgmgr = configmgr.getConfigMgr()
creatoropts = cfgmgr.create
- cfgmgr._ksconf = args[0]
+ ksconf = args[0]
+
+ recording_pkgs = None
+ if creatoropts['release'] is not None:
+ recording_pkgs = "name"
+ ksconf = misc.save_ksconf_file(ksconf, creatoropts['release'])
+ name = os.path.splitext(os.path.basename(ksconf))[0]
+ creatoropts['outdir'] = "%s/%s-%s/" % (creatoropts['outdir'], name, creatoropts['release'])
+ cfgmgr._ksconf = ksconf
# try to find the pkgmgr
pkgmgr = None
@@ -56,6 +64,10 @@ class SLPlugin(ImagerPlugin):
raise errors.CreatorError("Can't find package manager: %s" % creatoropts['pkgmgr'])
creator = SLPImageCreator(creatoropts, pkgmgr)
+
+ if recording_pkgs is not None:
+ creator._recording_pkgs = recording_pkgs
+
try:
creator.check_depend_tools()
creator.mount(None, creatoropts["cachedir"])
@@ -63,6 +75,9 @@ class SLPlugin(ImagerPlugin):
creator.configure(creatoropts["repomd"])
creator.unmount()
creator.package(creatoropts["outdir"])
+
+ if creatoropts['release'] is not None:
+ misc.create_release(ksconf, creatoropts['outdir'], creatoropts['name'], creator.outimage, creatoropts['release'])
creator.print_outimage_info()
except errors.CreatorError: