mirror of
https://github.com/zuno/slackpkgplus
synced 2025-01-13 20:01:04 +01:00
Improve givepriority performance by reducing I/O
This commit is contained in:
parent
3e25c62989
commit
ec930bb357
1 changed files with 4 additions and 2 deletions
|
@ -758,7 +758,8 @@ if [ "$SLACKPKGPLUS" = "on" ];then
|
|||
if [ ! -z "$PKGINFOS" ] ; then
|
||||
LINEIDX=${$PKGINFOS/:*/} #LINEIDX=$(echo "$PKGINFOS" | cut -f1 -d":")
|
||||
PKGDATA=( ${PKGINFOS/*:/} ) #PKGDATA=( $(echo "$PKGINFOS" | cut -f2- -d":") )
|
||||
sed -i --expression "${LINEIDX}d" --expression "${PRIORITYIDX}i${PKGDATA[*]}" ${TMPDIR}/pkglist
|
||||
mv ${TMPDIR}/pkglist ${TMPDIR}/pkglist.old
|
||||
sed -i --expression "${LINEIDX}d" --expression "${PRIORITYIDX}i${PKGDATA[*]}" ${TMPDIR}/pkglist.old > ${TMPDIR}/pkglist
|
||||
(( PRIORITYIDX++ ))
|
||||
if [ "$PKGDATA" ]; then
|
||||
NAME=${PKGDATA[1]}
|
||||
|
@ -852,7 +853,8 @@ if [ "$SLACKPKGPLUS" = "on" ];then
|
|||
# R1:P is before R2:P in pkglist, and the user issue install|upgrade R2:P, slackpkg
|
||||
# will install R1:P instead.
|
||||
#
|
||||
sed -i --expression "${LINEIDX}d" --expression "${PRIORITYIDX}i${PKGDATA[*]}" ${TMPDIR}/pkglist
|
||||
mv ${TMPDIR}/pkglist ${TMPDIR}/pkglist.old
|
||||
sed --expression "${LINEIDX}d" --expression "${PRIORITYIDX}i${PKGDATA[*]}" ${TMPDIR}/pkglist.old > ${TMPDIR}/pkglist
|
||||
(( PRIORITYIDX++ ))
|
||||
fi
|
||||
done
|
||||
|
|
Loading…
Reference in a new issue