version 1.9, 2021/10/16 19:42:43 |
version 1.10, 2021/10/17 03:05:29 |
|
|
echo "Uninstalling $installed" |
echo "Uninstalling $installed" |
cwd=${PKGDIR}/$installed |
cwd=${PKGDIR}/$installed |
|
|
remove="${cwd}/+CONTENTS ${cwd}" |
set -A _remove -- "${cwd}/+CONTENTS" "${cwd}" |
|
|
while read c g; do |
while read c g; do |
case $c in |
case $c in |
|
|
;; |
;; |
@*) continue |
@*) continue |
;; |
;; |
*) remove="$cwd/$c $remove" |
*) set -A _remove -- "$cwd/$c" "${_remove[@]}" |
;; |
;; |
esac |
esac |
done < "${PKGDIR}/$installed/+CONTENTS" |
done < "${PKGDIR}/$installed/+CONTENTS" |
|
|
for r in $remove ; do |
for _r in "${_remove[@]}"; do |
if [ -d "$r" ]; then |
if [ -d "$_r" ]; then |
# Try hard not to actually remove recursively |
# Try hard not to actually remove recursively |
# without rmdir on the install media. |
# without rmdir on the install media. |
[ "$r/*" = $( echo "$r"/* ) ] && rm -rf "$r" |
[ "$_r/*" = $( echo "$_r"/* ) ] && rm -rf "$_r" |
else |
else |
rm -f "$r" |
rm -f "$_r" |
fi |
fi |
done |
done |
fi |
fi |