Drop the dnf Base object deletion code and use reset
It appears that reset+fill_sack will now do the right thing and load the state of the installed packages. Drop the hack with deleting the object. Also add a double-check to make sure there really is a list of files for anaconda-core before we run off and make an image without removing anything.
This commit is contained in:
parent
9ff5897eee
commit
13de711548
@ -556,22 +556,13 @@ class LoraxTemplateRunner(object):
|
|||||||
logger.info("Performing post-installation setup tasks")
|
logger.info("Performing post-installation setup tasks")
|
||||||
process.join()
|
process.join()
|
||||||
|
|
||||||
# close down the base and re-init it to pick up changes
|
# Reset the package sack to pick up the installed packages
|
||||||
self.dbo.close()
|
self.dbo.reset(repos=False)
|
||||||
del self.dbo
|
self.dbo.fill_sack(load_system_repo=True, load_available_repos=False)
|
||||||
|
|
||||||
self.dbo = dnf.Base()
|
# At this point dnf should know about the installed files. Double check that it really does.
|
||||||
conf = self.dbo.conf
|
if len(self._filelist("anaconda-core")) == 0:
|
||||||
# Point inside the installroot
|
raise Exception("Failed to reset dbo to installed package set")
|
||||||
conf.installroot = self.outroot
|
|
||||||
conf.prepend_installroot('persistdir')
|
|
||||||
conf.debuglevel = 10
|
|
||||||
conf.errorlevel = 0
|
|
||||||
RELEASEVER = dnf.rpm.detect_releasever(self.dbo.conf.installroot)
|
|
||||||
self.dbo.conf.substitutions['releasever'] = RELEASEVER
|
|
||||||
self.dbo.read_all_repos()
|
|
||||||
self.dbo.fill_sack(load_system_repo=False)
|
|
||||||
self.dbo.read_comps()
|
|
||||||
|
|
||||||
def removefrom(self, pkg, *globs):
|
def removefrom(self, pkg, *globs):
|
||||||
'''
|
'''
|
||||||
|
Loading…
Reference in New Issue
Block a user