diff options
Diffstat (limited to 'build_tools/bin')
-rwxr-xr-x | build_tools/bin/reset_pacman_chroot.sh | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/build_tools/bin/reset_pacman_chroot.sh b/build_tools/bin/reset_pacman_chroot.sh new file mode 100755 index 0000000..3e75922 --- /dev/null +++ b/build_tools/bin/reset_pacman_chroot.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +echo "Removing all but base..." +#pacman -R $(comm -23 <(pacman -Qq | sort) <((for i in $(pacman -Qqg base); do pactree -ul "$i"; done) | sort -u)) +#pacman -R $(comm -23 <(pacman -Qq | sort) <(( +pacman -Qq | sort > /tmp/allInstalled.reset +rm /tmp/baseDeps.reset +for i in $(pacman -Qqg base) +do + pactree -ul "$i" >> /tmp/baseDeps.reset +done +sort -u /tmp/baseDeps.reset > /tmp/baseDepsSorted.reset + +removePkgs="$(comm -23 /tmp/allInstalled.reset /tmp/baseDepsSorted.reset)" + +pacman -R --noconfirm $removePkgs + +#echo "Adding back other packages..." +pacman -S --noconfirm base-devel openssh git python2 dosfstools rsync squashfs-tools libisoburn python2-gitpython parched unison arch-install-scripts lynx python2-ndg-httpsclient wget findbrokenpkgs tig |