This commit is contained in:
emmett1
2017-09-24 01:03:08 +08:00
parent eb798fe7dc
commit d14b8b86f6
2 changed files with 18 additions and 34 deletions

View File

@@ -70,11 +70,11 @@ installpkg() {
if [ $? != 0 ]; then
msgerr "Failed install ${color_red}$packagename${color_reset}."
pushd $ROOT_DIR
while IFS=' ' read -r line; do
rm_silent "$line" || rmdir_silent --ignore-fail-on-non-empty "$line"
pushd $ROOT_DIR
rm_silent "$line" || rmdir_silent --ignore-fail-on-non-empty "$line"
popd
done < <(tar -tf "$PKGNAME" --exclude=.pkginfo --exclude=.pkginstall --exclude=.pkgreadme ${excludefile[@]} | tac)
popd
spkglock
exit 1
fi
@@ -199,13 +199,13 @@ checkpkgconflict() {
checkconflict() {
pushd $ROOT_DIR
while IFS=' ' read -r line; do
if [ -e "$line" ]; then
fileconflict+=(${line})
fi
done < <(tar -tf "$PKGNAME" --exclude=.pkginfo --exclude=.pkginstall --exclude=.pkgreadme ${excludefile[@]} | grep -v '/$')
popd
while IFS=' ' read -r line; do
pushd $ROOT_DIR
if [ -e "$line" ]; then
fileconflict+=(${line})
fi
popd
done < <(tar -tf "$PKGNAME" --exclude=.pkginfo --exclude=.pkginstall --exclude=.pkgreadme ${excludefile[@]} | grep -v '/$')
if [ "${#fileconflict[@]}" -gt 0 ]; then
msgerr "File conflict found:"
@@ -219,15 +219,15 @@ checkconflict() {
upcheckconflict() {
pushd $ROOT_DIR
while IFS=' ' read -r line; do
if [ -e "$line" ]; then
if [ ! "$(grep -Fx "$line" "$INDEX_DIR/$name/.files")" ]; then
fileconflict+=(${line})
fi
while IFS=' ' read -r line; do
pushd $ROOT_DIR
if [ -e "$line" ]; then
if [ ! "$(grep -Fx "$line" "$INDEX_DIR/$name/.files")" ]; then
fileconflict+=(${line})
fi
done < <(tar -tf "$PKGNAME" --exclude=.pkginfo --exclude=.pkginstall --exclude=.pkgreadme ${excludefile[@]} | grep -v '/$')
popd
fi
popd
done < <(tar -tf "$PKGNAME" --exclude=.pkginfo --exclude=.pkginstall --exclude=.pkgreadme ${excludefile[@]} | grep -v '/$')
if [ "${#fileconflict[@]}" -gt 0 ]; then
msgerr "File conflict found:"

16
scratch
View File

@@ -523,14 +523,6 @@ parse_options() {
OUTPUT_PKG="$2"
shift
;;
--root)
if [ ! "$2" ]; then
msg "Option '$1' require an argument (root path)."
exit 1
fi
ROOT="$2"
shift
;;
*)
msg "Option invalid!"
exit 1
@@ -554,14 +546,6 @@ main() {
loadconfigfile
# CHANGE ROOT PATH ###
if [ "$ROOT" ]; then
ROOT_DIR="$ROOT"
INDEX_DIR="$ROOT_DIR$INDEX_DIR"
BACKUP_DIR="$ROOT_DIR$BACKUP_DIR"
REJECTED_DIR="$ROOT_DIR$REJECTED_DIR"
fi
### SHOW PORT PATH ###
if [ $PORT_PATH ]; then
showportpath