fix pkgdel did not remove symlink

This commit is contained in:
emmett1
2019-02-18 15:17:04 +08:00
parent 42f666418d
commit a21565a239
3 changed files with 7 additions and 3 deletions

2
pkgadd
View File

@@ -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"

4
pkgdel
View File

@@ -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

View File

@@ -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"
}