mirror of
https://github.com/zuno/slackpkgplus
synced 2024-12-27 09:58:34 +01:00
slackpkg+-search-duplicate-packages-fix-V7.patch.txt
This commit is contained in:
parent
eda8f2dd23
commit
e2a831b918
1 changed files with 29 additions and 9 deletions
|
@ -1091,13 +1091,14 @@ if [ "$SLACKPKGPLUS" = "on" ];then
|
||||||
[ "$SENSITIVE_SEARCH" = "off" ] && GREPOPTS="--ignore-case"
|
[ "$SENSITIVE_SEARCH" = "off" ] && GREPOPTS="--ignore-case"
|
||||||
|
|
||||||
# -- PKGLIST:
|
# -- PKGLIST:
|
||||||
# temporary file used to store data about packages. It uses
|
# temporary file used to store data about handled packages. It uses
|
||||||
# the following format:
|
# the following format:
|
||||||
# repo:<repository_name>:bname:<package_basename>:ver:<package_version>:fname:<package_fullname>:
|
# repo:<repository_name>:bname:<package_basename>:ver:<package_version>:fname:<package_fullname>:
|
||||||
#
|
#
|
||||||
PKGLIST=$(tempfile --directory=$TMPDIR)
|
PKGLIST=$(tempfile --directory=$TMPDIR)
|
||||||
PKGINFOS=$(tempfile --directory=$TMPDIR)
|
PKGINFOS=$(tempfile --directory=$TMPDIR)
|
||||||
|
|
||||||
|
|
||||||
for i in ${PRIORITY[@]}; do
|
for i in ${PRIORITY[@]}; do
|
||||||
DIR="$i"
|
DIR="$i"
|
||||||
if [[ "$DIR" =~ ^[-_[:alnum:]]+[:] ]] ; then # was if echo "$DIR" | grep -q "[a-zA-Z0-9]\+[:]" ; then
|
if [[ "$DIR" =~ ^[-_[:alnum:]]+[:] ]] ; then # was if echo "$DIR" | grep -q "[a-zA-Z0-9]\+[:]" ; then
|
||||||
|
@ -1127,7 +1128,7 @@ if [ "$SLACKPKGPLUS" = "on" ];then
|
||||||
}' l_dir=${DIR} > $PKGINFOS
|
}' l_dir=${DIR} > $PKGINFOS
|
||||||
|
|
||||||
else # -- CMD==search
|
else # -- CMD==search
|
||||||
grep -h ${GREPOPTS} "^$DIR" ${WORKDIR}/pkglist ${TMPDIR}/pkglist-pre|grep -E ${GREPOPTS} "/SLACKPKGPLUS_$SEARCHSTR/|/$SEARCHSTR/|/$SEARCHSTR | [^ /]*$SEARCHSTR[^ /]* " > $PKGINFOS
|
grep -h ${GREPOPTS} "^$DIR" ${TMPDIR}/pkglist ${TMPDIR}/pkglist-pre|grep -E ${GREPOPTS} "/SLACKPKGPLUS_$SEARCHSTR/|/$SEARCHSTR/|/$SEARCHSTR | [^ /]*$SEARCHSTR[^ /]* " > $PKGINFOS
|
||||||
fi
|
fi
|
||||||
|
|
||||||
while read PKGDIR PKGBASENAME PKGVER PKGARCH PKGBUILD PKGFULLNAME PKGPATH PKGEXT ; do
|
while read PKGDIR PKGBASENAME PKGVER PKGARCH PKGBUILD PKGFULLNAME PKGPATH PKGEXT ; do
|
||||||
|
@ -1140,14 +1141,26 @@ if [ "$SLACKPKGPLUS" = "on" ];then
|
||||||
|
|
||||||
if grep ${GREPOPTS} -q ":bname:${PKGBASENAME}:" $PKGLIST ; then
|
if grep ${GREPOPTS} -q ":bname:${PKGBASENAME}:" $PKGLIST ; then
|
||||||
|
|
||||||
# if the current package P is installed, this means the previous P' will be
|
# P' has precedence over P. Therefore, P must be displayed with masked
|
||||||
# proposed as an upgrade to P. In this case, the loop must continue without
|
# attribute, unless when installed, in which case P' will be proposed
|
||||||
# any other action...
|
# as an upgrade to P.
|
||||||
grep ${GREPOPTS} -q " $PKGFULLNAME " ${TMPDIR}/tmplist && continue
|
|
||||||
|
|
||||||
# The current package P is not installed. In this case P must be shown as
|
MASKED=true
|
||||||
# being uninstalled and masked.
|
|
||||||
|
if grep ${GREPOPTS} -q " $PKGFULLNAME " ${TMPDIR}/tmplist ; then
|
||||||
|
COUNT=$(grep ":$PKGFULLNAME:" $PKGLIST | wc -l)
|
||||||
|
|
||||||
|
# P is installed. It should not be masked. However, when different
|
||||||
|
# repositories offer the same package (ie. same name,version,arch,
|
||||||
|
# build) this rule must be applied only when there's *no occurence*
|
||||||
|
# of fullname(P) in PKGLIST (ie. list of handled packages).
|
||||||
|
#
|
||||||
|
[ $COUNT -eq 0 ] && MASKED=false
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ $MASKED = true ] ; then
|
||||||
LIST="$LIST MASKED_${PKGDIR}:${PKGFULLNAME}"
|
LIST="$LIST MASKED_${PKGDIR}:${PKGFULLNAME}"
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
LIST="$LIST ${PKGDIR}:${PKGFULLNAME}"
|
LIST="$LIST ${PKGDIR}:${PKGFULLNAME}"
|
||||||
fi
|
fi
|
||||||
|
@ -1227,6 +1240,13 @@ if [ "$SLACKPKGPLUS" = "on" ];then
|
||||||
STATUS="installed"
|
STATUS="installed"
|
||||||
echo " $STATUS# $REPO# $CINSTPKG"
|
echo " $STATUS# $REPO# $CINSTPKG"
|
||||||
else
|
else
|
||||||
|
|
||||||
|
INSTPKG_REPO=$(grep -m 1 "$CINSTPKG" ${WORKDIR}/pkglist | cut -f1 -d" " | sed "s/SLACKPKGPLUS_//")
|
||||||
|
|
||||||
|
if [ ! -z "$INSTPKG_REPO" ] && [ "$INSTPKG_REPO" != "$REPO" ] ; then
|
||||||
|
CINSTPKG="$INSTPKG_REPO:$CINSTPKG"
|
||||||
|
fi
|
||||||
|
|
||||||
STATUS="upgrade"
|
STATUS="upgrade"
|
||||||
echo " $STATUS# $REPO# $CINSTPKG --> ${RAWNAME}"
|
echo " $STATUS# $REPO# $CINSTPKG --> ${RAWNAME}"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue