puke: cleanup

This commit is contained in:
Dylan Araps 2019-05-13 17:08:29 +03:00
parent 7bc5cee716
commit c5a09feb10

10
puke
View File

@ -142,9 +142,13 @@ pkg_remove() {
pkg_list "$name" || return 1
while read -r file; do
[ "${file%/*}" = "/etc" ] && continue
rm -d -- "$sys_dir$file" 2>/dev/null && log "Removed $file"
if [ "${file%/*}" = "/etc" ]; then
continue
elif [ -d "$sys_dir$file" ]; then
rmdir "$sys_dir$file" 2>/dev/null
else
rm -- "$sys_dir$file" || log "Failed to remove $file."
fi && log "Removed $file"
done < "$sys_dir/$dbs_dir/$name/manifest"
return 0