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")) buildstamp.write(joinpaths(self.inroot, ".buildstamp"))
dname = joinpaths(self.workdir, "pkglists") if self.debug:
if not os.path.isdir(dname): rb.writepkglists(joinpaths(self.workdir, "pkglists"))
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))
logger.info("doing post-install configuration") logger.info("doing post-install configuration")
rb.postinstall() rb.postinstall()

View File

@ -80,6 +80,15 @@ class RuntimeBuilder(object):
'''Install packages and do initial setup with runtime-install.tmpl''' '''Install packages and do initial setup with runtime-install.tmpl'''
self._runner.run("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): def postinstall(self):
'''Do some post-install setup work with runtime-postinstall.tmpl''' '''Do some post-install setup work with runtime-postinstall.tmpl'''
# copy configdir into runtime root beforehand # copy configdir into runtime root beforehand