mirror of
https://github.com/zuno/slackpkgplus
synced 2024-12-27 09:58:34 +01:00
The "comma" syntax also accept ",*". They are equivalent. There's
differences only in the code :)
This commit is contained in:
parent
f6bad17f8d
commit
c3df72d808
1 changed files with 8 additions and 8 deletions
|
@ -1090,7 +1090,7 @@ if [ "$SLACKPKGPLUS" = "on" ];then
|
||||||
unset LINEIDX
|
unset LINEIDX
|
||||||
unset PKGINFOS
|
unset PKGINFOS
|
||||||
|
|
||||||
[[ "${ORIARGUMENT%,*},*" == "${ORIARGUMENT}" ]]&&[[ "${ARGUMENT}" != "${ORIARGUMENT%,*}" ]]&&return
|
[[ "${ORIARGUMENT}" =~ ,\*?$ ]]&&[[ "${ARGUMENT}" != "${ORIARGUMENT%,*}" ]]&&return
|
||||||
ARGUMENT="${ARGUMENT%,*}"
|
ARGUMENT="${ARGUMENT%,*}"
|
||||||
|
|
||||||
if [ -z "$TOPROCESS" ];then
|
if [ -z "$TOPROCESS" ];then
|
||||||
|
@ -1330,8 +1330,8 @@ if [ "$SLACKPKGPLUS" = "on" ];then
|
||||||
}' l_dir=${DIR} > $PKGINFOS
|
}' l_dir=${DIR} > $PKGINFOS
|
||||||
|
|
||||||
else # -- CMD==search
|
else # -- CMD==search
|
||||||
if [[ "${SEARCHSTR}" =~ .*,$ ]];then
|
if [[ "${SEARCHSTR}" =~ ,\*?$ ]];then
|
||||||
grep -h ${GREPOPTS} "^$DIR" ${TMPDIR}/pkglist ${TMPDIR}/pkglist-pre|grep -E ${GREPOPTS} "^[^ ]* ${SEARCHSTR%,} " > $PKGINFOS
|
grep -h ${GREPOPTS} "^$DIR" ${TMPDIR}/pkglist ${TMPDIR}/pkglist-pre|grep -E ${GREPOPTS} "^[^ ]* ${SEARCHSTR%,*} " > $PKGINFOS
|
||||||
else
|
else
|
||||||
grep -h ${GREPOPTS} "^$DIR" ${TMPDIR}/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
|
||||||
|
@ -1490,7 +1490,7 @@ if [ "$SLACKPKGPLUS" = "on" ];then
|
||||||
fi
|
fi
|
||||||
done|sort
|
done|sort
|
||||||
echo -en "\r" >&2
|
echo -en "\r" >&2
|
||||||
}|column -t -s '#' -o ' '|( [[ "$CMD" == "search" ]]&&grep -E -i --color -e ^ -e "${PATTERN%,}"||cat )
|
}|column -t -s '#' -o ' '|( [[ "$CMD" == "search" ]]&&grep -E -i --color -e ^ -e "${PATTERN%,*}"||cat )
|
||||||
} # END function searchlistEX()
|
} # END function searchlistEX()
|
||||||
|
|
||||||
# Show detailed info for slackpkg info
|
# Show detailed info for slackpkg info
|
||||||
|
@ -2388,8 +2388,8 @@ if [ "$SLACKPKGPLUS" = "on" ];then
|
||||||
searchlistEX "$LIST"
|
searchlistEX "$LIST"
|
||||||
echo -e "\nYou can search specific files using \"slackpkg file-search file\".\n"
|
echo -e "\nYou can search specific files using \"slackpkg file-search file\".\n"
|
||||||
fi
|
fi
|
||||||
if [[ "${PATTERN}" =~ .*,$ ]];then
|
if [[ "${PATTERN}" =~ ,\*?$ ]];then
|
||||||
SBORESULT="$(grep -E -i "^SBO_[^ ]* ${PATTERN/,/} " $WORKDIR/pkglist 2>/dev/null|awk '{print $6}')"
|
SBORESULT="$(grep -E -i "^SBO_[^ ]* ${PATTERN%,*} " $WORKDIR/pkglist 2>/dev/null|awk '{print $6}')"
|
||||||
else
|
else
|
||||||
SBORESULT="$(grep -E -i "^SBO_[^ ]* [^ ]*${PATTERN}" $WORKDIR/pkglist 2>/dev/null|awk '{print $6}')"
|
SBORESULT="$(grep -E -i "^SBO_[^ ]* [^ ]*${PATTERN}" $WORKDIR/pkglist 2>/dev/null|awk '{print $6}')"
|
||||||
fi
|
fi
|
||||||
|
@ -2397,7 +2397,7 @@ if [ "$SLACKPKGPLUS" = "on" ];then
|
||||||
echo
|
echo
|
||||||
echo "Also found in SBo (download it with 'slackpkg download <package>'):"
|
echo "Also found in SBo (download it with 'slackpkg download <package>'):"
|
||||||
echo
|
echo
|
||||||
echo -e "[package]\n$SBORESULT"|sed -e 's/ / /' -e 's/^/ /' -e 's/ \[/[ /g' -e 's/\]/ ]/g'|grep --color -E -i -e "${PATTERN%,}" -e ^
|
echo -e "[package]\n$SBORESULT"|sed -e 's/ / /' -e 's/^/ /' -e 's/ \[/[ /g' -e 's/\]/ ]/g'|grep --color -E -i -e "${PATTERN%,*}" -e ^
|
||||||
echo
|
echo
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
@ -2520,7 +2520,7 @@ if [ "$SLACKPKGPLUS" = "on" ];then
|
||||||
|
|
||||||
echo -n "Looking for $(echo $INPUTLIST | tr -d '\\') in package list. Please wait... "
|
echo -n "Looking for $(echo $INPUTLIST | tr -d '\\') in package list. Please wait... "
|
||||||
for ARGUMENT in $(echo $INPUTLIST); do
|
for ARGUMENT in $(echo $INPUTLIST); do
|
||||||
if [[ "$ARGUMENT" =~ , ]];then
|
if [[ "$ARGUMENT" =~ ,\*?$ ]];then
|
||||||
for i in $(grep " ${ARGUMENT%,*} " ${TMPDIR}/pkglist | cut -f2 -d\ | sort -u); do
|
for i in $(grep " ${ARGUMENT%,*} " ${TMPDIR}/pkglist | cut -f2 -d\ | sort -u); do
|
||||||
LIST="$LIST $(grep " ${i} " ${TMPDIR}/pkglist |grep " ${ARGUMENT%,*} " | cut -f6,8 -d\ --output-delimiter=.)"
|
LIST="$LIST $(grep " ${i} " ${TMPDIR}/pkglist |grep " ${ARGUMENT%,*} " | cut -f6,8 -d\ --output-delimiter=.)"
|
||||||
done
|
done
|
||||||
|
|
Loading…
Reference in a new issue