handle migrated rpmdb path

Related: https://pagure.io/koji/issue/3617
This commit is contained in:
Tomas Kopecek 2022-12-07 12:41:35 +01:00
parent 752c76ab7d
commit 39fc11a439

View file

@ -696,7 +696,13 @@ class BuildRoot(object):
'sigmd5',
'size',
'buildtime')
rpm.addMacro("_dbpath", "%s/var/lib/rpm" % self.rootdir())
# Determine db path
dbpath = "%s/var/lib/rpm" % self.rootdir()
if os.path.exists(os.path.join(dbpath, '.migratedb')):
dbpath = "%s/usr/lib/sysimage/rpm" % self.rootdir()
if not os.path.exists(dbpath):
raise koji.GenericError("Can't get list of installed rpms")
rpm.addMacro("_dbpath", dbpath)
ret = []
try:
ts = rpm.TransactionSet()