support SBo current from ponce

Allow to download metadata from SBo-current from cgit.ponce.cc

put
SBOURL=http://cgit.ponce.cc/slackbuilds/

in configuration
This commit is contained in:
Matteo Rossini 2021-06-24 23:39:59 +02:00
parent 01a2bde343
commit 51ab518385

View file

@ -452,6 +452,7 @@ if [ "$SLACKPKGPLUS" = "on" ];then
GPG-KEY) TOCACHE=0 ; CURREPO=${1/*gpgkey-tmp-/};;
FILELIST.TXT) TOCACHE=1 ;;
SLACKBUILDS.TXT.gz) TOCACHE=1 ; CURREPO=SBo ;;
slackbuilds-current-*.tar.gz) TOCACHE=0 ; CURREPO=SBo ;;
esac
if [ -z "$CURREPO" ]; then
CURREPO=slackware
@ -597,7 +598,7 @@ if [ "$SLACKPKGPLUS" = "on" ];then
fi
if [ $(basename $1) = "FILELIST.TXT" ];then
if [ ! -z "$SBOURL" ];then
if echo "$SBOURL"|grep -q SLACKBUILDS.TXT.gz ;then
SBOURL=${SBOURL%/}/
$DOWNLOADER $TMPDIR/SLACKBUILDS.TXT.gz ${SBOURL}SLACKBUILDS.TXT.gz
zcat $TMPDIR/SLACKBUILDS.TXT.gz |awk '{
@ -607,6 +608,24 @@ if [ "$SLACKPKGPLUS" = "on" ];then
if($1=="") print name,version,location
}' > $WORKDIR/sbolist
fi
if echo "$SBOURL"|grep -q ponce;then
SBOURL=${SBOURL%/}/
SBOtag=$(basename $(curl -s $SBOURL|grep "/slackbuilds/tag/?h=" |head -1|grep -oE "href='[^']+'"|cut -f2 -d"'"|grep tar.gz))
SBOlast=$(cat $WORKDIR/sbolist.tag 2>/dev/null)
if echo $SBOtag|grep -q slackbuilds-current-.*tar.gz && [ "$SBOtag" != "$SBOlast" ];then
$DOWNLOADER $TMPDIR/$SBOtag ${SBOURL}snapshot/$SBOtag
(
cd $TMPDIR
tar xf $TMPDIR/*$SBOtag
cd slackbuilds-current*/
find . -name \*.info|while read SBOinfo;do
source $SBOinfo
echo $PRGNAM $VERSION $(dirname $SBOinfo)
done > $WORKDIR/sbolist
echo $SBOtag > $WORKDIR/sbolist.tag
)
fi
fi
fi
if [ $(basename $1) = "MANIFEST.bz2" ];then
@ -2245,7 +2264,7 @@ if [ "$SLACKPKGPLUS" = "on" ];then
searchlistEX "$LIST"
echo -e "\nYou can search specific files using \"slackpkg file-search file\".\n"
fi
if [ ! -z "$SBOURL" ];then
if echo "$SBOURL"|grep -q SLACKBUILDS.TXT.gz ;then
SBORESULT="$(grep -E -i "^[^ ]*$PATTERN" $WORKDIR/sbolist 2>/dev/null|sed -e 's/ /-/' -e "s#\./#$SBOURL#" -e 's/$/.tar.gz/')"
if [ ! -z "$SBORESULT" ];then
echo
@ -2253,8 +2272,19 @@ if [ "$SLACKPKGPLUS" = "on" ];then
echo
echo -e "[package] [url]\n$SBORESULT"|column -t|sed -e 's/ / /' -e 's/^/ /' -e 's/ \[/[ /g' -e 's/\]/ ]/g'|grep --color -E -i -e "$PATTERN" -e ^
echo
fi
fi
fi
fi
if echo "$SBOURL"|grep -q ponce;then
SBORESULT="$(grep -E -i "^[^ ]*$PATTERN" $WORKDIR/sbolist 2>/dev/null|sed -e 's/ /-/' -e "s#\./#${SBOURL}plain/#" -e 's#$#/#')"
if [ ! -z "$SBORESULT" ];then
echo
echo "Also found in SBo (download it with 'wget -r -np'):"
echo
echo -e "[package] [url]\n$SBORESULT"|column -t|sed -e 's/ / /' -e 's/^/ /' -e 's/ \[/[ /g' -e 's/\]/ ]/g'|grep --color -E -i -e "$PATTERN" -e ^
echo
fi
fi
;;