From a21565a23971e16a2c802274f4ed9e66019b77c8 Mon Sep 17 00:00:00 2001 From: emmett1 Date: Mon, 18 Feb 2019 15:17:04 +0800 Subject: [PATCH] fix pkgdel did not remove symlink --- pkgadd | 2 +- pkgdel | 4 ++-- scratch | 4 ++++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/pkgadd b/pkgadd index fe95696..4443581 100755 --- a/pkgadd +++ b/pkgadd @@ -250,7 +250,7 @@ if [ ! "$IGNORE_CONFLICT" ]; then if [ "$line" = "${line%.*}.spkgnew" ]; then line=${line%.*} fi - if [ -e "$ROOT/$line" ]; then + if [ -e "$ROOT/$line" ] || [ -L "$ROOT/$line" ]; then if [ "$UPGRADE_PKG" ] || [ "$REINSTALL_PKG" ]; then if [ ! "$(grep -Fx "$line" "$INDEX_DIR/$name/.files")" ]; then echo "$line" diff --git a/pkgdel b/pkgdel index a19f3f2..272f55a 100755 --- a/pkgdel +++ b/pkgdel @@ -201,7 +201,7 @@ fi if [ -f "$INDEX_DIR/$name/.bkpfiles" ]; then while IFS=' ' read -r line; do - if [ -e "$ROOT/$line" ]; then + if [ -e "$ROOT/$line" ] || [ -L "$ROOT/$line" ]; then [ "$VERBOSE_REMOVE" = yes ] && echo "<<< $line" rm "$ROOT/$line" fi @@ -209,7 +209,7 @@ if [ -f "$INDEX_DIR/$name/.bkpfiles" ]; then fi while IFS=' ' read -r line; do - if [ -e "$ROOT/$line" ]; then + if [ -e "$ROOT/$line" ] || [ -L "$ROOT/$line" ]; then [ "$VERBOSE_REMOVE" = yes ] && echo "<<< $line" rm "$ROOT/$line" fi diff --git a/scratch b/scratch index e50c351..b394897 100755 --- a/scratch +++ b/scratch @@ -362,6 +362,10 @@ updports() { esac if [ -n "$repodir" ] && [ -n "$repourl" ]; then httpup sync $repourl $repodir + if [ $? != 0 ]; then + msgerr "Failed sync from $repourl" + exit 1 + fi fi done < "$REPO_FILE" }