This commit is contained in:
emmett1
2018-11-20 17:46:37 +08:00
parent 645f87e68b
commit 54c416224f

11
pkgadd
View File

@@ -251,11 +251,7 @@ fi
opr=Installing; oprdone=installed
[ "$UPGRADE_PKG" ] && { opr=Upgrading; oprdone=upgraded; }
[ "$REINSTALL_PKG" ] && { opr=Reinstalling; oprdone=reinstalled; }
if [ "$SILENT_INSTALL" ]; then
echo -ne "$opr '$name-$version-$release'... "
else
msg "$opr '$name-$version-$release'..."
fi
[ "$SILENT_INSTALL" ] || msg "$opr '$name-$version-$release'..."
#ignore conflict
if [ ! "$IGNORE_CONFLICT" ]; then
@@ -310,9 +306,6 @@ fi
)
#installing package into system
COLUMN=$(stty size | awk '{print $2}')
COL=$(($COLUMN-4))
CURPOS="\e[${COL}G"
total=$(cat $TMP_PKGADD/files | grep -Ev '(.pkginfo|.pkginstall|.pkgreadme)' | wc -l)
count=0
@@ -322,7 +315,7 @@ installcmd="tar --keep-directory-symlink -p -x -v -f $PKGNAME -C ${ROOT:-/} --ex
rm -f $TMP_PKGINSTALL $TMP_PKGINSTALL_BKP
$installcmd | while IFS=' ' read line; do
count=$(( $count + 1 ))
[ "$SILENT_INSTALL" ] && echo -ne "${CURPOS}$(( 100*$count/$total ))%\r"
[ "$SILENT_INSTALL" ] && echo -ne " $opr $name-$version-$release [ $(( 100*$count/$total ))% ]\r"
if [ "$line" = "${line%.*}.spkgnew" ]; then
echo "$line" >> $TMP_PKGINSTALL_BKP
line=${line%.*}