From b63a4ae03a7126d0661735d2aa2f6382b368bdc1 Mon Sep 17 00:00:00 2001 From: Matteo Rossini Date: Tue, 13 Jul 2021 11:31:15 +0200 Subject: [PATCH] Fri Jul 9 00:47:35 CEST 2021 pkg/slackpkg+-1.7.7-noarch-1mt.txz: - Added support for SBo-current repository (by cgit ponce) - slackpkg download can download SBo scripts - Replaced SBOURL with array SBO to allow multiple repository. please do not change the default value. +-------------------------+ --- ChangeLog.txt | 8 +++ src/CHANGES | 11 ++-- src/ChangeLog.txt | 8 +++ src/README | 10 ++- src/slackpkgplus.conf.5 | 14 ++--- src/slackpkgplus.conf.5.it | 12 ++-- src/slackpkgplus.sh | 111 ++++++++++++++++++++++++++------- src/slackpkgplus.x86.sample | 7 ++- src/slackpkgplus.x86_64.sample | 7 ++- src/zchangelog.sh | 8 +-- 10 files changed, 146 insertions(+), 50 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 7a9c7d7..f598d04 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,3 +1,11 @@ +Fri Jul 9 00:47:35 CEST 2021 +pkg/slackpkg+-1.7.7-noarch-1mt.txz: + - Added support for SBo-current repository (by cgit ponce) + - slackpkg download can download SBo scripts + - Replaced SBOURL with array SBO to allow multiple repository. please + do not change the default value. ++-------------------------+ + Sun Jul 4 23:51:46 CEST 2021 pkg/slackpkg+-1.7.6-noarch-9mt.txz: Rebuilt - Just updated repositories in documentation and in sample config diff --git a/src/CHANGES b/src/CHANGES index 61f2375..b82cdbd 100644 --- a/src/CHANGES +++ b/src/CHANGES @@ -1,6 +1,6 @@ = Full Changes list = -== From 1.7 to 1.7.6 == +== From 1.7 to 1.7.7 == *Configuration file: @@ -8,7 +8,8 @@ - Changed some default settings in sample configuration file -- Added SBOURL to configure the SlackBuild.org repository (search only) +- Added SBO to configure the SlackBuild.org repository (search and download). + Please do not touch the default values. - Added USETERSE to use the --terse mode for pkgtools @@ -33,8 +34,9 @@ ignore. For example a failure installing packages. - Added SBo support. This does not replace sbopkg. It just search in - SlackBuilds.org and report the url to download to build and install - packages yourself. + SlackBuilds.org and report the presence of the package; he can download + if via 'slackpkg download ', then build and install + packages himself. - Added httpdir/httpsdir/ftpdir repositories. These repositories does not need metadatas (CHECKSUMS.md5 ...), simple a remote directory listing @@ -59,6 +61,7 @@ set PLUGIN_ZCHANGELOG_SHOW=on to print changelog on stdout For details read notes in the code: /usr/libexec/slackpkg/functions.d/zchangelog.sh + It does not support SBo repositories *BugFixes diff --git a/src/ChangeLog.txt b/src/ChangeLog.txt index 7a9c7d7..f598d04 100644 --- a/src/ChangeLog.txt +++ b/src/ChangeLog.txt @@ -1,3 +1,11 @@ +Fri Jul 9 00:47:35 CEST 2021 +pkg/slackpkg+-1.7.7-noarch-1mt.txz: + - Added support for SBo-current repository (by cgit ponce) + - slackpkg download can download SBo scripts + - Replaced SBOURL with array SBO to allow multiple repository. please + do not change the default value. ++-------------------------+ + Sun Jul 4 23:51:46 CEST 2021 pkg/slackpkg+-1.7.6-noarch-9mt.txz: Rebuilt - Just updated repositories in documentation and in sample config diff --git a/src/README b/src/README index b999cfa..f111059 100644 --- a/src/README +++ b/src/README @@ -535,12 +535,18 @@ Note that a short pattern may match many many packages. ----- -SBOURL +SBO -'slackpkg search' allow you to search packages in SlackBuilds.org. +'slackpkg search' allow you to search packages in SlackBuilds.org 14.2 and +current. Note that slackpkg+ does not replace sbopkg or other similar tools. slackpkg+ show you the url of the SlackBuild, then you have to manually download, build and install it, or use sbopkg to do that. +Note that slackpkg+ does not replace sbopkg o similar tools, but is only +useful to know if a package is present on SBo. +The user can download it via 'slackpkg download ', then build it, +or he can use sbopkg instead. + ----- diff --git a/src/slackpkgplus.conf.5 b/src/slackpkgplus.conf.5 index dc442c2..d6f764d 100644 --- a/src/slackpkgplus.conf.5 +++ b/src/slackpkgplus.conf.5 @@ -34,7 +34,7 @@ Here is the list of available settings: \fBMain settings\fP .ds 1 SLACKPKGPLUS\t\t\ton/off\t\ton\t\tyes -.ds 2 MIRRORPLUS\t\t\tstring\t\t-\t\tno +.ds 2 MIRRORPLUS[]\t\t\tstrings\t\t-\t\tno .ds 3 REPOPLUS\t\t\t\tlist\t\t\t-\t\tno .ds 4 PKGS_PRIORITY\t\t\tlist\t\t\t-\t\tno .ds 5 TAG_PRIORITY\t\t\ton/off\t\toff\t\tyes @@ -54,7 +54,7 @@ Here is the list of available settings: \fBDownload settings\fP .ds 1 VERBOSE\t\t\t\t0,1,2,3\t\t1\t\tyes .ds 2 USETERSE\t\t\t\ton/off\t\toff\t\tyes -.ds 3 PROXY\t\t\t\tstrings\t\t-\t\tyes +.ds 3 PROXY\t\t\t\tstring\t\t-\t\tyes .ds 4 WGETOPTS\t\t\t\tstring\t\t-\t\tyes .ds 5 DOWNLOADCMD\t\t\tstring\t\twget\t\tyes .ds 6 DOWNLOADONLY\t\t\ton/off\t\toff\t\tyes @@ -89,7 +89,7 @@ Here is the list of available settings: .ds 4 GREYLIST\t\t\t\ton/off\t\ton\t\tyes .ds 5 SENSITIVE_SEARCH\t\ton/off\t\ton\t\tyes .ds 6 WW_FILE_SEARCH\t\t\ton/off\t\ton\t\tyes -.ds 7 SBOURL\t\t\t\tstring\t\t-\t\tno +.ds 7 SBO[]\t\t\t\tstrings\t\t-\t\tno .in +2 \*1 .br @@ -404,13 +404,13 @@ Setting \fB\%WW_FILE_SEARCH\fP=\fIoff\fP command \fB\%file-search\fP will also l Note that the search for too short strings can pull out hundreds and hundreds of results and take a long time. .TP 5 -\fBSBOURL\fP +\fBSBO\fP .br -The \fB\%slackpkg\ search\fP command allow you to search packages in the SlackBuilds.org repository. +The \fB\%slackpkg\ search\fP command allow you to search packages in the SlackBuilds.org repositories for 14.2 and current -\fB\%SBOURL\fP contains the url of SlackBuilds.org repository. It it is not set, the search will be skipped. +\fB\%SBO\fP contains the urls of SlackBuilds.org repository. It it is not set, the search will be skipped. -Note that slackpkg+ does not replace \fB\%sbopkg\fP o similar tools, but is only useful to know if a package is present on SBo. slackpkg+ show you the url, so the user can manually download and compile it, or he can use sbopkg instead. +Note that slackpkg+ does not replace \fB\%sbopkg\fP o similar tools, but is only useful to know if a package is present on SBo. The user can download it via \fB\%slackpkg\ download\ \fP, then build it, or he can use sbopkg instead. .TP 5 diff --git a/src/slackpkgplus.conf.5.it b/src/slackpkgplus.conf.5.it index a16e7ee..f0f3371 100644 --- a/src/slackpkgplus.conf.5.it +++ b/src/slackpkgplus.conf.5.it @@ -34,7 +34,7 @@ Seguono le differenti impostazioni disponibili: \fBImpostazioni principali\fP .ds 1 SLACKPKGPLUS\t\t\ton/off\t\ton\t\tsi -.ds 2 MIRRORPLUS\t\t\tstringa\t\t-\t\tno +.ds 2 MIRRORPLUS[]\t\t\tstringhe\t\t-\t\tno .ds 3 REPOPLUS\t\t\t\telenco\t\t-\t\tno .ds 4 PKGS_PRIORITY\t\t\telenco\t\t-\t\tno .ds 5 TAG_PRIORITY\t\t\ton/off\t\toff\t\tsi @@ -54,7 +54,7 @@ Seguono le differenti impostazioni disponibili: \fBImpostazioni di download\fP .ds 1 VERBOSE\t\t\t\t0,1,2,3\t\t1\t\tsi .ds 2 USETERSE\t\t\t\ton/off\t\toff\t\tsi -.ds 3 PROXY\t\t\t\tstrings\t\t-\t\tsi +.ds 3 PROXY\t\t\t\tstringa\t\t-\t\tsi .ds 4 WGETOPTS\t\t\t\tstringa\t\t-\t\tsi .ds 5 DOWNLOADCMD\t\t\tstringa\t\twget\t\tsi .ds 6 DOWNLOADONLY\t\t\ton/off\t\toff\t\tsi @@ -89,7 +89,7 @@ Seguono le differenti impostazioni disponibili: .ds 4 GREYLIST\t\t\t\ton/off\t\ton\t\tsi .ds 5 SENSITIVE_SEARCH\t\ton/off\t\ton\t\tsi .ds 6 WW_FILE_SEARCH\t\t\ton/off\t\ton\t\tsi -.ds 7 SBOURL\t\t\t\tstringa\t\t-\t\tno +.ds 7 SBO[]\t\t\t\tstringhe\t\t-\t\tno .in +2 \*1 .br @@ -404,11 +404,11 @@ Nota che la ricerca per stringhe troppo corte pu .TP 5 \fBSBOURL\fP .br -Il comando \fB\%slackpkg\ search\fP consente di effettuare la ricerca anche nel repository di SlackBuilds.org. +Il comando \fB\%slackpkg\ search\fP consente di effettuare la ricerca anche nei repository di SlackBuilds.org 14.2 e current. -\fB\%SBOURL\fP contiene l'indirizzo del repository di SlackBuilds.org. Se non viene settata la ricerca non verrà effettuata. +\fB\%SBO\fP contiene gli indirizzi dei repository di SlackBuilds.org. Se non viene settata la ricerca non verrà effettuata. -Nota che slackpkg+ non sostituisce \fB\%sbopkg\fP o altri tool, ma serve solo per sapere se un pacchetto è presente o meno su SBo. slackpkg+ mostra l'url, poi l'utente dovrà scaricarlo e compilarlo manualmente oppure affidarsi a sbopkg. +Nota che slackpkg+ non sostituisce \fB\%sbopkg\fP o altri tool, ma serve solo per sapere se un pacchetto è presente o meno su SBo. L'utente potrà scaricarlo via \fB\%slackpkg\ download\ \fP, poi compilarlo manualmente oppure affidarsi a sbopkg. .TP 5 diff --git a/src/slackpkgplus.sh b/src/slackpkgplus.sh index c48df02..c83b242 100755 --- a/src/slackpkgplus.sh +++ b/src/slackpkgplus.sh @@ -4,6 +4,7 @@ # A special thanks to all packagers that make slackpkg+ useful declare -A MIRRORPLUS +declare -A SBO declare -A NOTIFYMSG # regular expression used to distinguish the 3rd party repositories from the standard slackware directories. @@ -178,6 +179,9 @@ if [ "$SLACKPKGPLUS" = "on" ];then fi rm -f ${TMPDIR}/waiting if [ "$CMD" == "update" ];then + if [ -e $TMPDIR/pkglist.sbo ];then + cat $TMPDIR/pkglist.sbo >> $WORKDIR/pkglist + fi if [ "$ANSWER" != "Y" ] && [ "$ANSWER" != "y" ]; then touch $WORKDIR/pkglist fi @@ -456,6 +460,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-cur ;; esac if [ -z "$CURREPO" ]; then CURREPO=slackware @@ -533,6 +538,48 @@ if [ "$SLACKPKGPLUS" = "on" ];then local URLFILE URLFILE=$1 + if echo $URLFILE|grep -q /SBO_;then + local PRGNAM + local DESTFILE=$2 + local NAMEPKG + if echo $URLFILE|grep -q "\.\.asc$";then return 0;fi + PREPO=$(echo $URLFILE|sed -r 's#^.*/SBO_([^/]+)/.*$#\1#') + if [ "$PREPO" == "current" ];then + SBO['current']=${SBO['current']}plain/ + fi + NAMEPKG=$(basename $URLFILE .) + PRGNAM=$(echo $NAMEPKG|sed "s#-[^-]*-sbo-$PREPO\$##") + URLFILE=$(dirname $URLFILE) + URLFILE=$(echo $URLFILE|sed "s#^.*/SBO_$PREPO/#${SBO[$PREPO]}#") + DESTFILE=$(dirname $DESTFILE) + if [ "$PREPO" == "current" ];then + rm -rf ${DESTFILE} + mkdir -p ${DESTFILE} + ( + cd ${DESTFILE} + wget -r -np $WGETOPTS -nv -nH $WGETOPTS $URLFILE/ + mv slackbuilds/plain/*/$PRGNAM $NAMEPKG + rm -f $NAMEPKG/index.html + rm -f robots.txt + rm -rf slackbuilds/ + echo "Downloaded in $(readlink -f ${DESTFILE})" + ) + else + rm -rf ${DESTFILE} + mkdir ${DESTFILE} + wget $WGETOPTS -nv ${URLFILE}.tar.gz -O ${DESTFILE}/${PRGNAM}.tar.gz + ( + cd $DESTFILE + tar xf ${PRGNAM}.tar.gz + mv ${PRGNAM} ${NAMEPKG} + rm -f ${PRGNAM}.tar.gz + echo "Downloaded in $(readlink -f ${DESTFILE})" + ) + fi + return 0 + + fi + if [ $(basename $1) = "CHECKSUMS.md5.asc" ];then if [ -e $TMPDIR/signaturedownloaded ];then echo " Done." @@ -601,16 +648,38 @@ if [ "$SLACKPKGPLUS" = "on" ];then fi if [ $(basename $1) = "FILELIST.TXT" ];then - if [ ! -z "$SBOURL" ];then - SBOURL=${SBOURL%/}/ - $DOWNLOADER $TMPDIR/SLACKBUILDS.TXT.gz ${SBOURL}SLACKBUILDS.TXT.gz - zcat $TMPDIR/SLACKBUILDS.TXT.gz |awk '{ - if($2=="NAME:") name=$3 - if($2=="LOCATION:") location=$3 - if($2=="VERSION:") version=$3 - if($1=="") print name,version,location - }' > $WORKDIR/sbolist - fi + touch $TMPDIR/pkglist.sbo + for SBOKEY in ${!SBO[*]};do + SBOURL=${SBO[$SBOKEY]} + if [ "$SBOKEY" == "current" ];then + SBOURL=${SBOURL%/}/ + SBOtag=$(basename $(curl --max-time 10 --location -s $SBOURL|grep "/slackbuilds/tag/?h=" |head -1|grep -oE "href='[^']+'"|cut -f2 -d"'"|grep tar.gz)) + SBOlast=$(cat $WORKDIR/sbolist_${SBOKEY}.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_${SBOKEY} + echo $SBOtag > $WORKDIR/sbolist_${SBOKEY}.tag + ) + fi + else + SBOURL=${SBOURL%/}/ + $DOWNLOADER $TMPDIR/SLACKBUILDS.TXT.gz ${SBOURL}SLACKBUILDS.TXT.gz + zcat $TMPDIR/SLACKBUILDS.TXT.gz |awk '{ + if($2=="NAME:") name=$3 + if($2=="LOCATION:") location=$3 + if($2=="VERSION:") version=$3 + if($1=="") print name,version,location + }' > $WORKDIR/sbolist_${SBOKEY} + fi + cat $WORKDIR/sbolist_${SBOKEY}|awk '{print "SBO_'$SBOKEY' "$1" "$2" sbo '$SBOKEY' "$1"-"$2"-sbo-'$SBOKEY' "$3}'|sed "s,\./,./SBO_$SBOKEY/," >> $TMPDIR/pkglist.sbo + done fi if [ $(basename $1) = "MANIFEST.bz2" ];then @@ -878,7 +947,7 @@ if [ "$SLACKPKGPLUS" = "on" ];then local REPO local PREPO - if echo $1|egrep -q "/SLACKPKGPLUS_(file|dir|http|ftp|https)[0-9]";then + if echo $1|egrep -q -e "/SLACKPKGPLUS_(file|dir|http|ftp|https)[0-9]" -e "/SBO_";then echo 1 return fi @@ -961,7 +1030,7 @@ if [ "$SLACKPKGPLUS" = "on" ];then local PREPO local ARG - if echo $1|egrep -q "/SLACKPKGPLUS_(file|dir|http|ftp|https)[0-9]";then + if echo $1|egrep -q -e "/SLACKPKGPLUS_(file|dir|http|ftp|https)[0-9]" -e "/SBO_";then echo 1 return fi @@ -1811,7 +1880,7 @@ if [ "$SLACKPKGPLUS" = "on" ];then cleanup fi - SPKGPLUS_VERSION="1.7.6" + SPKGPLUS_VERSION="1.7.7" VERSION="$VERSION / slackpkg+ $SPKGPLUS_VERSION" if [ ${VERSION:0:4} == "2.82" ];then @@ -1975,6 +2044,9 @@ if [ "$SLACKPKGPLUS" = "on" ];then # echo -n "" > ${TMPDIR}/blacklist.slackpkgplus + if [ "$CMD" != "download" ];then + internal_blacklist "^SBO_" + fi if [ ! -z "$DOWNLOADCMD" ];then DOWNLOADER="$DOWNLOADCMD" @@ -2249,17 +2321,14 @@ if [ "$SLACKPKGPLUS" = "on" ];then searchlistEX "$LIST" echo -e "\nYou can search specific files using \"slackpkg file-search file\".\n" fi - if [ ! -z "$SBOURL" ];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 + SBORESULT="$(grep -E -i "^SBO_[^ ]* [^ ]*$PATTERN" $WORKDIR/pkglist 2>/dev/null|awk '{print $6}')" + if [ ! -z "$SBORESULT" ];then echo - echo "Also found in SBo:" + echo "Also found in SBo (download it with 'slackpkg download '):" 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 -e "[package]\n$SBORESULT"|sed -e 's/ / /' -e 's/^/ /' -e 's/ \[/[ /g' -e 's/\]/ ]/g'|grep --color -E -i -e "$PATTERN" -e ^ echo - fi - fi - + fi ;; file-search) diff --git a/src/slackpkgplus.x86.sample b/src/slackpkgplus.x86.sample index 952d5f1..c913ced 100644 --- a/src/slackpkgplus.x86.sample +++ b/src/slackpkgplus.x86.sample @@ -135,9 +135,10 @@ MIRRORPLUS['slackpkgplus']=https://slakfinder.org/slackpkg+15/ # SBo SlackBuilds. Uncomment it to allow slackpkg to search SlackBuilds on SlackBuilds.org -# This does not repleace sbopkg; slackpkg just report the package, version and url; you must -# download and build it yourself or via sbopkg. -#SBOURL=https://www.slackbuilds.org/slackbuilds/14.2/ +# This does not repleace sbopkg; slackpkg just report the package, version and url; you may +# download it via 'slackpkg download ' and build it yourself or via sbopkg. +#SBO['14.2']=https://www.slackbuilds.org/slackbuilds/14.2/ +#SBO['current']=https://cgit.ponce.cc/slackbuilds/ # Plugin section: diff --git a/src/slackpkgplus.x86_64.sample b/src/slackpkgplus.x86_64.sample index ba06664..c39b65f 100644 --- a/src/slackpkgplus.x86_64.sample +++ b/src/slackpkgplus.x86_64.sample @@ -150,9 +150,10 @@ MIRRORPLUS['slackpkgplus']=https://slakfinder.org/slackpkg+15/ # SBo SlackBuilds. Uncomment it to allow slackpkg to search SlackBuilds on SlackBuilds.org -# This does not repleace sbopkg; slackpkg just report the package, version and url; you must -# download and build it yourself or via sbopkg. -#SBOURL=https://www.slackbuilds.org/slackbuilds/14.2/ +# This does not repleace sbopkg; slackpkg just report the package, version and url; you may +# download it via 'slackpkg download ' and build it yourself or via sbopkg. +#SBO['14.2']=https://www.slackbuilds.org/slackbuilds/14.2/ +#SBO['current']=https://cgit.ponce.cc/slackbuilds/ # Plugin section: diff --git a/src/zchangelog.sh b/src/zchangelog.sh index ffc194d..de8598b 100755 --- a/src/zchangelog.sh +++ b/src/zchangelog.sh @@ -35,7 +35,7 @@ test -n "$(declare -f cleanup)" # || return eval "${_/cleanup/cleanup_orig}" function pkglistdiff (){ - diff $WORKDIR/pkglist.copy $WORKDIR/pkglist| + diff $WORKDIR/pkglist.copy $WORKDIR/pkglist|grep -v " SBO_"| grep -e "^>" -e "^<"| sed 's/SLACKPKGPLUS_//'| sort -k2| @@ -49,8 +49,8 @@ function makepkglog(){ if [ -z "$TMPDIR" ];then TMPDIR=/tmp;fi if [ -z "$WORKDIR" ];then WORKDIR=/var/lib/slackpkg;fi IGNORE="$( ( - cat $WORKDIR/pkglist.copy|awk '{print $1}'|sort -u|sed 's/SLACKPKGPLUS_//'|sed 's/^/Removed /' - cat $WORKDIR/pkglist |awk '{print $1}'|sort -u|sed 's/SLACKPKGPLUS_//'|sed 's/^/Added /' + cat $WORKDIR/pkglist.copy|grep -v ^SBO_|awk '{print $1}'|sort -u|sed 's/SLACKPKGPLUS_//'|sed 's/^/Removed /' + cat $WORKDIR/pkglist |grep -v ^SBO_|awk '{print $1}'|sort -u|sed 's/SLACKPKGPLUS_//'|sed 's/^/Added /' )|sort -k2|uniq -f1 -u)" echo "$IGNORE"|awk '{print $1": "$2}'|column -t |sort -k2|grep ...&&echo echo "$IGNORE"|awk '{print " "$2" "}'|grep ... >$TMPDIR/ignorerepos @@ -84,7 +84,7 @@ function cleanup(){ cat $WORKDIR/RepoChangeLog.txt >> $TMPDIR/RepoChangeLog.txt cp $TMPDIR/RepoChangeLog.txt $WORKDIR/RepoChangeLog.txt fi - cp $WORKDIR/pkglist $WORKDIR/pkglist.copy + cat $WORKDIR/pkglist|grep -v ^SBO_ > $WORKDIR/pkglist.copy fi fi cleanup_orig