From 42f666418d69798a6e5da166ef38258bb80e4395 Mon Sep 17 00:00:00 2001 From: emmett1 Date: Fri, 8 Feb 2019 17:16:10 +0800 Subject: [PATCH] updated --- pkgadd | 13 ++++++------- pkgbase | 4 +++- pkgdel | 4 ++-- revdep | 2 +- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/pkgadd b/pkgadd index 319a6e8..fe95696 100755 --- a/pkgadd +++ b/pkgadd @@ -253,18 +253,17 @@ if [ ! "$IGNORE_CONFLICT" ]; then if [ -e "$ROOT/$line" ]; then if [ "$UPGRADE_PKG" ] || [ "$REINSTALL_PKG" ]; then if [ ! "$(grep -Fx "$line" "$INDEX_DIR/$name/.files")" ]; then - fileconflict+=(${line}) + echo "$line" + conflictedfile=yes fi else - fileconflict+=(${line}) + echo "$line" + conflictedfile=yes fi fi done < <(cat $TMP_PKGADD | grep -Ev '(.pkginfo|.pkginstall|.pkgreadme)' | grep -v '/$') - - if [ "${#fileconflict[@]}" -gt 0 ]; then - for fc in ${fileconflict[@]}; do - echo "$fc" - done + + if [ "$conflictedfile" = "yes" ]; then msgerr "File conflict found!" ret 1 fi diff --git a/pkgbase b/pkgbase index c1d46bd..ac888ef 100755 --- a/pkgbase +++ b/pkgbase @@ -23,6 +23,8 @@ for pkg in $allinstalled; do fi done -scratch remove $remove +if [ -n "$remove" ]; then + scratch remove $remove +fi exit $? diff --git a/pkgdel b/pkgdel index 113abb0..a19f3f2 100755 --- a/pkgdel +++ b/pkgdel @@ -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" ]; then [ "$VERBOSE_REMOVE" = yes ] && echo "<<< $line" rm "$ROOT/$line" fi @@ -217,7 +217,7 @@ done < <(tac $INDEX_DIR/$name/.files | grep -v '/$') while IFS=' ' read -r line; do if [ ! "$(grep -R --exclude-dir="$name" -w "$line" "$INDEX_DIR")" ]; then - if [ -d $ROOT/$line ]; then + if [ -d "$ROOT/$line" ]; then [ "$VERBOSE_REMOVE" = yes ] && echo "<<< $line" rmdir "$ROOT/$line" fi diff --git a/revdep b/revdep index 6082cb8..64bd351 100755 --- a/revdep +++ b/revdep @@ -84,7 +84,7 @@ rebuild() { needrebuild=$ALLPKG fi - for allpkg in $(pkgdeplist $needrebuild | cut -d ' ' -f2); do + for allpkg in $(pkgdeplist -l $needrebuild | cut -d ' ' -f2); do for pkg in $needrebuild; do if [ $pkg = $allpkg ]; then if [ -z "$order" ]; then