Clean rpm db directory of broken symlinks
Related: https://pagure.io/koji/issue/3892
This commit is contained in:
parent
303c4daeb1
commit
a1ad698630
1 changed files with 10 additions and 3 deletions
|
|
@ -697,9 +697,16 @@ class BuildRoot(object):
|
|||
'size',
|
||||
'buildtime')
|
||||
# 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()
|
||||
dbpath = "%s/usr/lib/sysimage/rpm" % self.rootdir()
|
||||
if not os.path.exists(dbpath):
|
||||
# older variant (<rhel10, <fedora39)
|
||||
dbpath = "%s/var/lib/rpm" % self.rootdir()
|
||||
else:
|
||||
# if new dbpath is used and mock is running older rpm on builder
|
||||
# _db* symlinks could exist in migrated directory
|
||||
for f in glob.glob('%s/__db*' % dbpath):
|
||||
if not os.path.isfile(f):
|
||||
os.unlink(f)
|
||||
if not os.path.exists(dbpath):
|
||||
raise koji.GenericError("Can't get list of installed rpms")
|
||||
rpm.addMacro("_dbpath", dbpath)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue