archboot/usr/bin/archboot-not-installed.sh

25 lines
883 B
Bash
Raw Normal View History

2023-02-07 09:22:33 +01:00
#!/usr/bin/env bash
2023-08-11 17:19:18 +02:00
# SPDX-License-Identifier: GPL-3.0-or-later
2023-02-07 09:22:33 +01:00
# created by Tobias Powalowski <tpowa@archlinux.org>
2023-09-01 13:28:32 +02:00
. /usr/lib/archboot/common.sh
_archboot_check
2023-09-04 21:50:25 +02:00
# consider only license or locale as uninstalled
2023-09-05 07:51:38 +02:00
rm -r /usr/share/{licenses,locale}
rm -r /usr/lib/{systemd,tmpfiles.d}
2023-02-07 09:14:40 +01:00
pacman -Sy
pacman -Q | cut -d ' ' -f1 >packages.txt
2023-09-04 09:33:55 +02:00
#shellcheck disable=SC2013
2023-02-07 09:14:40 +01:00
for i in $(cat packages.txt); do
2023-09-06 11:44:56 +02:00
rm -r "${_PACMAN_LIB}"/local/"${i}"-*-[0-9]*
#shellcheck disable=SC2086
2023-09-06 11:51:28 +02:00
if pacman -Sdd ${i} --noconfirm >>log.txt; then
2023-07-06 07:31:26 +02:00
echo "${i}" >> uninstalled.orig.txt
else
#shellcheck disable=SC2086
2023-09-04 21:17:37 +02:00
pacman -Sdd ${i} --noconfirm --overwrite '*'
fi
2023-02-07 09:14:40 +01:00
done
2023-07-05 12:28:40 +02:00
# remove false positives
2023-09-05 08:18:10 +02:00
grep -v -E "ca-certificates|iana-etc|linux-firmware-marvell|linux-firmware-whence|pambase|pacman-mirrorlist|licenses" uninstalled.orig.txt >uninstalled.txt
# vim: set ft=sh ts=4 sw=4 et: