Skip to content

Commit

Permalink
fix bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
niaow committed Nov 7, 2017
1 parent 3c5e903 commit 91fef53
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions inst.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ if [ -e "$dbd" ]; then
update=1
echo "Replacing $NAME-$(cat "$dbd/version") with $NAME-$VERSION"

tdel=$(grep -xFvf <(scanlists) "$tmpdir/.files.list")
tdel=$(scanlists | grep -xFvf - "$tmpdir/.files.list")
if [ $? -gt 1 ]; then
fail "Error searching for files to delete" 2
fi
Expand Down Expand Up @@ -130,7 +130,7 @@ fi
# delete old files (if applicable)
if [ $update -eq 1 ]; then
if [ ! -z "$tdel" ]; then
rm -r $tdel || fail "Failed to delete old files" 3
rm -rf $tdel || fail "Failed to delete old files" 3
fi
fi

Expand Down
2 changes: 1 addition & 1 deletion lpkg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ elif [ "$1" == "install" ]; then
pins=$(cat "$LPKGDIR/pins.list") || fail "Failed to read pin list" 2
transact $pins $@ || fail "Transaction failed" 3
for i in $@; do
if ! contains $i $@; then
if ! contains $i $pins; then
echo $i >> "$LPKGDIR/pins.list"
fi
done
Expand Down
4 changes: 2 additions & 2 deletions rm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ scanlists() {
done
}

tdel=$(grep -xFvf <(scanlists) "$dbd/files.list")
tdel=$(scanlists | grep -xFvf - "$dbd/files.list")
if [ $? -gt 1 ]; then
fail "Error searching for files to delete" 2
fi
Expand All @@ -62,7 +62,7 @@ if [ -e "$dbd/hook" ]; then
"$dbd/hook" remove || fail "Removal hook returned error code $?" 3
fi

rm -r $tdel || fail "Failed to delete files" 3
rm -rf $tdel || fail "Failed to delete files" 3
rm -r "$dbd" || fail "Failed to remove database entry" 3

rm -rf "$LPKGDIR/lpkg.lock"
Expand Down

0 comments on commit 91fef53

Please sign in to comment.