From e7aed411345d7208ad441f1aadec7ac38481365c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Thu, 26 Jan 2023 06:04:50 +0100 Subject: [PATCH] Handle dom0 rpmdb in /usr/lib/sysimage/rpm too When dom0 gets updated to newer Fedora, its rpmdb is in /usr/lib/sysimage/rpm. Handle this case by checking for this directory too - and check if that's really a directory, not a symlink to one. QubesOS/qubes-issues#6982 --- package-managers/qubes-download-dom0-updates.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/package-managers/qubes-download-dom0-updates.sh b/package-managers/qubes-download-dom0-updates.sh index 51c7e3f98..8681c7013 100755 --- a/package-managers/qubes-download-dom0-updates.sh +++ b/package-managers/qubes-download-dom0-updates.sh @@ -73,11 +73,15 @@ fi mkdir -p $DOM0_UPDATES_DIR/etc # Check if we need to copy rpmdb somewhere else +DOM0_DBPATH=/var/lib/rpm +if [ -d "$DOM0_UPDATES_DIR/usr/lib/sysimage/rpm" ] && ! [ -L "$DOM0_UPDATES_DIR/usr/lib/sysimage/rpm" ]; then + DOM0_DBPATH=/usr/lib/sysimage/rpm +fi DBPATH=$(rpm --eval '%{_dbpath}') -if [ ! "$DBPATH" = "/var/lib/rpm" ]; then +if [ ! "$DBPATH" = "$DOM0_DBPATH" ]; then mkdir -p "$DOM0_UPDATES_DIR$DBPATH" rm -rf -- "$DOM0_UPDATES_DIR$DBPATH" - cp -r "$DOM0_UPDATES_DIR/var/lib/rpm" "$DOM0_UPDATES_DIR$DBPATH" + cp -r "$DOM0_UPDATES_DIR$DOM0_DBPATH" "$DOM0_UPDATES_DIR$DBPATH" fi # Rebuild rpm database in case of different rpm version rm -f -- "$DOM0_UPDATES_DIR$DBPATH"/__*