mirror of
https://github.com/outbackdingo/scratchpkg.git
synced 2026-02-06 01:16:34 +00:00
updated
This commit is contained in:
@@ -76,7 +76,7 @@ rmdir_silent() {
|
||||
}
|
||||
|
||||
rm_silent() {
|
||||
command rm -d "$@" 2> /dev/null
|
||||
command rm "$@" 2> /dev/null
|
||||
}
|
||||
|
||||
nocolor() {
|
||||
|
||||
18
installpkg
18
installpkg
@@ -13,6 +13,11 @@ installpkg() {
|
||||
|
||||
msg "Installing ${color_green}$packagename${color_reset}..."
|
||||
|
||||
# noextract file into system
|
||||
for noextr in ${NO_EXTRACT[@]}; do
|
||||
excludefile+=(--exclude=$noextr)
|
||||
done
|
||||
|
||||
#ignore dependency check
|
||||
if [ ! "$IGNORE_DEP" ]; then
|
||||
msg2 "Checking package dependencies..."
|
||||
@@ -44,11 +49,6 @@ installpkg() {
|
||||
run_preupgrade
|
||||
fi
|
||||
|
||||
# noextract file into system
|
||||
for noextr in ${NO_EXTRACT[@]}; do
|
||||
excludefile+=(--exclude=$noextr)
|
||||
done
|
||||
|
||||
#installing package into system
|
||||
msg2 "Extracting package..."
|
||||
if [ "$VERBOSE_INSTALL" ]; then
|
||||
@@ -58,7 +58,7 @@ installpkg() {
|
||||
fi
|
||||
|
||||
if [ $? != 0 ]; then
|
||||
msg "Failed install ${color_red}$packagename${color_reset}."
|
||||
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"
|
||||
@@ -147,7 +147,7 @@ checkpkgconflict() {
|
||||
|
||||
}
|
||||
|
||||
checkconflict() {
|
||||
checkconflict() {
|
||||
|
||||
while IFS=' ' read -r line; do
|
||||
pushd $ROOT_DIR
|
||||
@@ -155,7 +155,7 @@ checkconflict() {
|
||||
fileconflict+=(${line})
|
||||
fi
|
||||
popd
|
||||
done < <(tar -tf "$PKGNAME" --exclude=.pkginfo --exclude=.pkginstall)
|
||||
done < <(tar -tf "$PKGNAME" --exclude=.pkginfo --exclude=.pkginstall --exclude=.pkgreadme ${excludefile[@]})
|
||||
|
||||
if [ "${#fileconflict[@]}" -gt 0 ]; then
|
||||
msgerr "File conflict found:"
|
||||
@@ -219,7 +219,7 @@ backupconf() {
|
||||
pushd $ROOT_DIR
|
||||
|
||||
for bkp in ${backup[@]}; do
|
||||
if [ -e $b ]; then
|
||||
if [ -e $bkp ]; then
|
||||
msg2 "Backup ${color_purple}$bkp${color_reset}"
|
||||
cp $bkp $BACKUP_DIR
|
||||
DONE_BACKUP=yes
|
||||
|
||||
38
removepkg
38
removepkg
@@ -31,16 +31,38 @@ removepkg() {
|
||||
run_preremove
|
||||
fi
|
||||
|
||||
msg2 "Deleting files..."
|
||||
msg2 "Removing files..."
|
||||
while IFS=' ' read -r line; do
|
||||
pushd $ROOT_DIR
|
||||
if [ "$VERBOSE_REMOVE" = "yes" ]; then
|
||||
rm_silent -v "$line" || rmdir_silent --ignore-fail-on-non-empty "$line"
|
||||
else
|
||||
rm_silent "$line" || rmdir_silent --ignore-fail-on-non-empty "$line"
|
||||
pushd $ROOT_DIR
|
||||
if [ "$VERBOSE_REMOVE" = "yes" ]; then
|
||||
rm_silent "$line" && echo " Removed: $line" || msgwarn "Failed remove $line"
|
||||
else
|
||||
rm_silent "$line" || msgwarn "Failed remove $line"
|
||||
fi
|
||||
popd
|
||||
done < <(tac $INDEX_DIR/$1/.files | grep -v '/$')
|
||||
|
||||
msg2 "Removing dirs..."
|
||||
while IFS=' ' read -r line; do
|
||||
NOREMOVE=""
|
||||
for allinst in $(ls $INDEX_DIR); do
|
||||
if [ $1 != $allinst ]; then
|
||||
if [ $(cat $INDEX_DIR/$allinst/.files | grep -w "$line") ]; then
|
||||
NOREMOVE=yes
|
||||
break
|
||||
fi
|
||||
fi
|
||||
popd
|
||||
done < <(tac $INDEX_DIR/$1/.files)
|
||||
done
|
||||
if [ ! "$NOREMOVE" ]; then
|
||||
pushd $ROOT_DIR
|
||||
if [ "$VERBOSE_REMOVE" = "yes" ]; then
|
||||
rmdir_silent "$line" && echo " Removed: $line" || msgwarn "Failed remove $line"
|
||||
else
|
||||
rmdir_silent "$line" || msgwarn "Failed remove $line"
|
||||
fi
|
||||
popd
|
||||
fi
|
||||
done < <(tac $INDEX_DIR/$1/.files | grep '/$')
|
||||
|
||||
if [ ! "$NO_POSTREMOVE" ]; then
|
||||
run_postremove
|
||||
|
||||
Reference in New Issue
Block a user