added -y opt to scratch_purge

This commit is contained in:
emmett1
2022-12-24 22:58:00 +08:00
parent ee33aaa213
commit 435209beb2

13
scratch
View File

@@ -1304,11 +1304,18 @@ scratch_missingdep() {
}
scratch_purge() {
needroot
needroot "Purging package"
while [ "$1" ]; do
case $1 in
-*) PURGEOPTS="$PURGEOPTS $1";;
*) PURGENAME="$PURGENAME $1";;
esac
shift
done
echo "Resolving dependencies..."
x=$(scratch_orphan $@)
x=$(scratch_orphan $PURGENAME)
if [ "$x" ]; then
scratch_remove $x
scratch_remove $x $PURGEOPTS
else
echo "No orphan packages found..."
fi