summaryrefslogtreecommitdiff
path: root/src/remove.sh
diff options
context:
space:
mode:
authordavidovski <david@davidovski.xyz>2022-03-03 00:42:23 +0000
committerdavidovski <david@davidovski.xyz>2022-03-03 00:42:23 +0000
commit6bc227cbffd0caa08d382f56df48cbb34f2afc59 (patch)
treeb67f1f91ccc7665bd2f1c41584de8bd4fb18e851 /src/remove.sh
parent24b636fadc9e0503f662e4a04c8e062556a76e20 (diff)
fixed removing packagesv1.0.4
Diffstat (limited to 'src/remove.sh')
-rw-r--r--src/remove.sh8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/remove.sh b/src/remove.sh
index cdea192..67bbbdd 100644
--- a/src/remove.sh
+++ b/src/remove.sh
@@ -5,6 +5,7 @@ remove () {
local to_remove="${CACHE_DIR}/toremove"
[ -f $to_remove ] && rm $to_remove
+ touch $to_remove
local real=""
for package in $@; do
@@ -12,7 +13,9 @@ remove () {
local filesfile="${package_dir}/files"
if [ -d $package_dir ]; then
[ -f $filesfile ] &&
- cat $filesfile >> $to_remove
+ while IFS= read -r file; do
+ echo ${SYSROOT}/$file >> $to_remove
+ done < $filesfile
echo $package_dir >> $to_remove
real="$real $package"
else
@@ -24,13 +27,14 @@ remove () {
${QUIET} || printf "${LIGHT_RED}The following packages will be removed from the system:\n\t${RED}%s\n" $real
${QUIET} || printf "${LIGHT_RED}Files to remove: ${RED}%s\n" $total
+ ${VERBOSE} && cat $to_remove
if prompt_question "Continue?"; then
local removed=0
${QUIET} || hbar
for file in $(cat $to_remove); do
- rm -rf ${SYSROOT}/$file
+ rm -rf $file
removed=$((removed+1))
${QUIET} || hbar ${HBAR_RED} -T "removing files" $removed $total