diff --git a/airootfs/root/customize_airootfs.sh b/airootfs/root/customize_airootfs.sh index 583447b..edb0a3f 100755 --- a/airootfs/root/customize_airootfs.sh +++ b/airootfs/root/customize_airootfs.sh @@ -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 diff --git a/airootfs/usr/share/sysrescue/bin/yay-prepare b/airootfs/usr/share/sysrescue/bin/yay-prepare index c89d06c..f250528 100755 --- a/airootfs/usr/share/sysrescue/bin/yay-prepare +++ b/airootfs/usr/share/sysrescue/bin/yay-prepare @@ -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