Merge branch 'yay-prepare-exclude' into 'main'

yay-prepare: don't reinstall packages from the sysrescuerepo

See merge request systemrescue/systemrescue-sources!238
This commit is contained in:
Gerd v. Egidy 2022-10-11 20:37:54 +00:00
commit 87e2abb28e
2 changed files with 10 additions and 2 deletions

View file

@ -59,6 +59,11 @@ systemctl mask ldconfig.service
/usr/bin/pacman-key --populate
rm -f /etc/pacman.d/gnupg/*~
# get a list of all packages from sysrescuerepo to exclude them from reinstall by yay-prepare
mkdir -p /usr/share/sysrescue/lib/
pacman -Sl sysrescuerepo | sed -e "s/^sysrescuerepo //" \
| sed -e "s/\[installed.*\]//" >/usr/share/sysrescue/lib/yay-prepare-exclude
# Cleanup
# ATTENTION: adapt airootfs/usr/share/sysrescue/bin/yay-prepare when deleting anything that
# could be required for building packages

View file

@ -54,8 +54,11 @@ for pkgfile in $(find /var/lib/pacman/local -name files -type f) ; do
exit 1
fi
REINSTALL+=($PKGNAME)
echo "package $PKGNAME needs to be reinstalled"
# exclude some packages from reinstallation, for example ones from the sysrescuerepo
if ! grep -q "$PKGNAME" /usr/share/sysrescue/lib/yay-prepare-exclude; then
REINSTALL+=($PKGNAME)
echo "package $PKGNAME needs to be reinstalled"
fi
fi
done