move pkglists to RuntimeBuilder and disable if not debugging

This commit is contained in:
Will Woods 2011-08-09 17:59:57 -04:00
parent 3153bdfa8a
commit 4f7584fe09
2 changed files with 11 additions and 7 deletions

View File

@ -188,13 +188,8 @@ class Lorax(BaseLoraxClass):
buildstamp.write(joinpaths(self.inroot, ".buildstamp"))
dname = joinpaths(self.workdir, "pkglists")
if not os.path.isdir(dname):
os.makedirs(dname)
for pkgobj in ybo.doPackageLists(pkgnarrow='installed').installed:
with open(joinpaths(dname, pkgobj.name), "w") as fobj:
for fname in pkgobj.filelist + pkgobj.dirlist:
fobj.write("{0}\n".format(fname))
if self.debug:
rb.writepkglists(joinpaths(self.workdir, "pkglists"))
logger.info("doing post-install configuration")
rb.postinstall()

View File

@ -80,6 +80,15 @@ class RuntimeBuilder(object):
'''Install packages and do initial setup with runtime-install.tmpl'''
self._runner.run("runtime-install.tmpl")
def writepkglists(self, pkglistdir):
'''debugging data: write out lists of package contents'''
if not os.path.isdir(pkglistdir):
os.makedirs(pkglistdir)
for pkgobj in self.yum.doPackageLists(pkgnarrow='installed').installed:
with open(joinpaths(pkglistdir, pkgobj.name), "w") as fobj:
for fname in pkgobj.filelist + pkgobj.dirlist:
fobj.write("{0}\n".format(fname))
def postinstall(self):
'''Do some post-install setup work with runtime-postinstall.tmpl'''
# copy configdir into runtime root beforehand