Merge branch 'test'

added httpdir
fix search packages
This commit is contained in:
Matteo Rossini 2020-03-15 21:52:44 +01:00
commit 136b506d04

View file

@ -546,11 +546,11 @@ if [ "$SLACKPKGPLUS" = "on" ];then
URLFILE=$(echo $URLFILE|sed "s#^.*/SLACKPKGPLUS_$PREPO/#${MIRRORPLUS[$PREPO]}#") URLFILE=$(echo $URLFILE|sed "s#^.*/SLACKPKGPLUS_$PREPO/#${MIRRORPLUS[$PREPO]}#")
fi fi
if echo $URLFILE | grep "^dir:/"|grep -q "/PACKAGES.TXT$";then if echo $URLFILE | grep "dir:/"|grep -q "/PACKAGES.TXT$";then
touch $2 touch $2
return 0 return 0
fi fi
if echo $URLFILE | grep "^dir:/"|grep -q "/MANIFEST.bz2$";then if echo $URLFILE | grep "dir:/"|grep -q "/MANIFEST.bz2$";then
echo -n|bzip2 -c >$2 echo -n|bzip2 -c >$2
return 0 return 0
fi fi
@ -564,7 +564,10 @@ if [ "$SLACKPKGPLUS" = "on" ];then
else else
return 1 return 1
fi fi
elif echo $URLFILE|grep -q -E dir:/.*asc$;then
return 0
else else
URLFILE=${URLFILE/dir:/:}
$DOWNLOADER $2 $URLFILE $DOWNLOADER $2 $URLFILE
fi fi
if [ $? -ne 0 ];then if [ $? -ne 0 ];then
@ -611,7 +614,7 @@ if [ "$SLACKPKGPLUS" = "on" ];then
if [ "$CHECKGPG" = "on" ];then if [ "$CHECKGPG" = "on" ];then
for PREPO in ${REPOPLUS[*]};do for PREPO in ${REPOPLUS[*]};do
URLFILE=${MIRRORPLUS[${PREPO/SLACKPKGPLUS_}]}CHECKSUMS.md5.asc URLFILE=${MIRRORPLUS[${PREPO/SLACKPKGPLUS_}]}CHECKSUMS.md5.asc
if echo $URLFILE | grep -q "^dir:/" ; then if echo $URLFILE | grep -q "dir:/" ; then
continue continue
fi fi
if echo $URLFILE | grep -q "^file://" ; then if echo $URLFILE | grep -q "^file://" ; then
@ -687,7 +690,7 @@ if [ "$SLACKPKGPLUS" = "on" ];then
BASEDIR=${MIRRORPLUS[${PREPO/SLACKPKGPLUS_}]%} BASEDIR=${MIRRORPLUS[${PREPO/SLACKPKGPLUS_}]%}
CLOGNAM=$PREPO.txt CLOGNAM=$PREPO.txt
if echo $BASEDIR | grep -q "^dir:/" ; then if echo $BASEDIR | grep -q "dir:/" ; then
# dir:/ repositories are ignored by slackpkg update # dir:/ repositories are ignored by slackpkg update
# but the ChangeLog must exists # but the ChangeLog must exists
touch ${TMPDIR}/ChangeLogs/$CLOGNAM touch ${TMPDIR}/ChangeLogs/$CLOGNAM
@ -751,6 +754,15 @@ if [ "$SLACKPKGPLUS" = "on" ];then
elif echo $URLFILE | grep -q "^dir:/" ; then elif echo $URLFILE | grep -q "^dir:/" ; then
touch ${TMPDIR}/CHECKSUMS.md5-$PREPO touch ${TMPDIR}/CHECKSUMS.md5-$PREPO
continue continue
elif echo $URLFILE | grep -q -e "^httpdir://" -e "^httpsdir://" -e "^ftpdir://" ; then
if [ "$CACHEUPDATE" == "on" ];then
printf " File: %-20s -> %-20s .. Downloading...\n" "$PREPO" "CHECKSUMS.md5"
lftp $(echo ${MIRRORPLUS[${PREPO/SLACKPKGPLUS_}]}|sed 's/dir//') -e "ls;quit" 2>/dev/null|awk '{print $NF}'|egrep '^.*-[^-]+-[^-]+-[^\.]+\.t.z$'|sort -rn| \
awk '{print "00000000000000000000000000000000 ./"$NF}' > ${TMPDIR}/CHECKSUMS.md5-$PREPO
else
lftp $(echo ${MIRRORPLUS[${PREPO/SLACKPKGPLUS_}]}|sed 's/dir//') -e "ls;quit" |awk '{print $NF}'|egrep '^.*-[^-]+-[^-]+-[^\.]+\.t.z$'|sort -rn| \
awk '{print "00000000000000000000000000000000 ./"$NF}' > ${TMPDIR}/CHECKSUMS.md5-$PREPO
fi
else else
$DOWNLOADER ${TMPDIR}/CHECKSUMS.md5-$PREPO ${MIRRORPLUS[${PREPO/SLACKPKGPLUS_}]}CHECKSUMS.md5 $DOWNLOADER ${TMPDIR}/CHECKSUMS.md5-$PREPO ${MIRRORPLUS[${PREPO/SLACKPKGPLUS_}]}CHECKSUMS.md5
fi fi
@ -799,7 +811,7 @@ if [ "$SLACKPKGPLUS" = "on" ];then
if echo $URLFILE | grep -q "^file://" ; then if echo $URLFILE | grep -q "^file://" ; then
URLFILE=${URLFILE:6} URLFILE=${URLFILE:6}
cp -v $URLFILE $2-tmp-$PREPO 2>/dev/null cp -v $URLFILE $2-tmp-$PREPO 2>/dev/null
elif echo $URLFILE |grep -q "^dir:/";then elif echo $URLFILE |grep -q "dir:/";then
continue continue
else else
echo echo
@ -901,7 +913,7 @@ if [ "$SLACKPKGPLUS" = "on" ];then
fi fi
ARG=$(echo $1|sed "s|^/*$TEMP/||") ARG=$(echo $1|sed "s|^/*$TEMP/||")
PREPO=$(echo $ARG | cut -f2 -d/|sed 's/SLACKPKGPLUS_//' ) PREPO=$(echo $ARG | cut -f2 -d/|sed 's/SLACKPKGPLUS_//' )
if echo ${MIRRORPLUS[$PREPO]}|grep -q ^dir:/;then if echo ${MIRRORPLUS[$PREPO]}|grep -q dir:/;then
echo 1 echo 1
return return
fi fi
@ -1143,7 +1155,7 @@ if [ "$SLACKPKGPLUS" = "on" ];then
# extract the pattern from $i, if and only if "$i" is to the syntax <repo>:<pattern>. Without # extract the pattern from $i, if and only if "$i" is to the syntax <repo>:<pattern>. Without
# this, PAT would be set to $DIR when $i is to the syntax <repo>. # this, PAT would be set to $DIR when $i is to the syntax <repo>.
# #
[[ "$DIR" =~ [:][:alnum:]+ ]] && PAT=${i/*:/} [[ "$i" =~ [:][[:alnum:]]+ ]] && PAT=${i/*:/}
# when the current priority is of kind <REPO>:<PATTERN>, the loop must be short-circuited # when the current priority is of kind <REPO>:<PATTERN>, the loop must be short-circuited
# when SEARCHSTR does not match PATTERN, otherwise, some packages could be mistakenly # when SEARCHSTR does not match PATTERN, otherwise, some packages could be mistakenly
@ -1795,7 +1807,7 @@ if [ "$SLACKPKGPLUS" = "on" ];then
# Test repositories # Test repositories
for pp in ${REPOPLUS[*]};do for pp in ${REPOPLUS[*]};do
echo "${MIRRORPLUS[$pp]}"|grep -q -e ^http:// -e ^https:// -e ^ftp:// -e ^file:// -e ^dir:/ echo "${MIRRORPLUS[$pp]}"|grep -q -e ^http:// -e ^https:// -e ^ftp:// -e ^file:// -e ^dir:/ -e ^httpdir:// -e ^httpsdir:// -e ^ftpdir://
if [ $? -ne 0 ];then if [ $? -ne 0 ];then
echo "Repository '$pp' not configured." >> $TMPDIR/error.log echo "Repository '$pp' not configured." >> $TMPDIR/error.log
echo "Add:" >> $TMPDIR/error.log echo "Add:" >> $TMPDIR/error.log