"comma" syntax applied to 'download' command

This commit is contained in:
Matteo Rossini 2022-01-08 19:43:41 +01:00
parent 0000f11008
commit f6bad17f8d

View file

@ -133,8 +133,6 @@ if [ "$SLACKPKGPLUS" = "on" ];then
# Patching makelist() original function to accept pkglist-pre
eval "$(type makelist | sed -e $'1d;2c\\\nmakelist()\n' \
-e 's,cat ${WORKDIR}/pkglist > ${TMPDIR}/pkglist,cat $TMPDIR/pkglist-pre ${WORKDIR}/pkglist | applyblacklist > ${TMPDIR}/pkglist,' \
-e 's/\(LIST.*pkglist\)\(.*--output-delimiter=.\)/\1 |grep -w -- \"${ARGUMENT}\"\2/'
)"
# Adds the pattern given by $(1) into the internal blacklist
@ -2514,6 +2512,38 @@ if [ "$SLACKPKGPLUS" = "on" ];then
cleanup
fi # "$CMD" == "check-updates"
if [ "$CMD" == "download" ];then
printf "%s\n" $ROOT/var/log/packages/* |
awk -f /usr/libexec/slackpkg/pkglist.awk > ${TMPDIR}/tmplist
cat $TMPDIR/pkglist-pre ${WORKDIR}/pkglist | applyblacklist > ${TMPDIR}/pkglist
echo -n "Looking for $(echo $INPUTLIST | tr -d '\\') in package list. Please wait... "
for ARGUMENT in $(echo $INPUTLIST); do
if [[ "$ARGUMENT" =~ , ]];then
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=.)"
done
else
for i in $(grep -w -- "${ARGUMENT}" ${TMPDIR}/pkglist | cut -f2 -d\ | sort -u); do
LIST="$LIST $(grep " ${i} " ${TMPDIR}/pkglist |grep -w -- "${ARGUMENT}" | cut -f6,8 -d\ --output-delimiter=.)"
done
fi
LIST="$(echo -e $LIST | sort -u)"
done
DELALL="off"
if ! [ "$LIST" = "" ]; then
showlist "$LIST" $CMD
for i in $SHOWLIST; do
getpkg $i true
done
else
echo -e "No packages match the pattern for download."
EXIT_CODE=20
fi
cleanup
fi
fi
INPROGRESS=0