From 0835728cb13a690c89a9271a4e40c7686a6e6a6c Mon Sep 17 00:00:00 2001 From: Matteo Rossini Date: Thu, 5 Sep 2013 16:38:14 +0200 Subject: [PATCH] Slackpkg+ 0.9.7 released Version 0.9.7 - 05/Sep/2013 - Added install/upgrade/reinstall from disk with file:package.txz or dir:path, and remote with {http,ftp,htts}://site/path/[package.txz], unrepositorized packages. Please, read the README file. - Disallow to choice the download manager; slackpkg+ require wget AND lftp --- ChangeLog.txt | 5 +++-- src/ChangeLog.txt | 5 +++-- src/README | 15 ++++++++++++--- src/slackpkgplus.sh | 16 +++++++++++++--- 4 files changed, 31 insertions(+), 10 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 4cdfb13..14783d8 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,7 +1,8 @@ -Version 20130905.3 - 05/Sep/2013 +Version 0.9.7 - 05/Sep/2013 - Added install/upgrade/reinstall from disk with file:package.txz or dir:path, - and remote with {http,ftp,htts}://site/path/package.txz, unrepositorized + and remote with {http,ftp,htts}://site/path/[package.txz], unrepositorized packages. Please, read the README file. + - Disallow to choice the download manager; slackpkg+ require wget AND lftp Version 0.9.6.1 - 02/Sep/2013 - fixed a bug in new dialog function (thanks to phenixia2003) diff --git a/src/ChangeLog.txt b/src/ChangeLog.txt index 4cdfb13..14783d8 100644 --- a/src/ChangeLog.txt +++ b/src/ChangeLog.txt @@ -1,7 +1,8 @@ -Version 20130905.3 - 05/Sep/2013 +Version 0.9.7 - 05/Sep/2013 - Added install/upgrade/reinstall from disk with file:package.txz or dir:path, - and remote with {http,ftp,htts}://site/path/package.txz, unrepositorized + and remote with {http,ftp,htts}://site/path/[package.txz], unrepositorized packages. Please, read the README file. + - Disallow to choice the download manager; slackpkg+ require wget AND lftp Version 0.9.6.1 - 02/Sep/2013 - fixed a bug in new dialog function (thanks to phenixia2003) diff --git a/src/README b/src/README index 42c6796..d662bb4 100644 --- a/src/README +++ b/src/README @@ -144,11 +144,13 @@ You can: # slackpkg install file:package-1.0-noarch-1my.txz or # slackpkg upgrade file:../repo/package-2.0-noarch-1my.txz -2) install/upgrade/reinstall all file packages in a single directory (does not allow subtree) by passing the directory name following the "/" simbol (optionally absolute or relative path): +2) install/upgrade/reinstall all file packages in a single directory (does not allow subtree) by passing a directory name (optionally absolute or relative path): # slackpkg install dir:/myrep # slackpkg upgrade dir:./test/package/ # slackpkg reinstall . '.' is an alias of 'dir:./', but only that alias exists. slackpkg install ./ or /myrepo/ or ./package.txz generate an error becouse in standard slackpkg you can specify a FILE as input, so in 'slackpkg install ./list.txt' list.txt must to be a plain file containing a list of packages to install (see man slackpkg) +If a directory contains the same package with two different version, slackpkg show the 'alfabetically' highest, so pkg-9.1 will be listed instead of pkg-8, ut pkg-9 will be also listed instead pkg-10. Sorry.. is a slackpkg limit! + Tip: if you want to use dir:/myrepo to track your installations and you have lost the original txz/tgz file, you can simply create an empty file; this fools slackpkg+ that only search for file name and not for contents (unless you do not run slackpkg reinstall on these packages ;)) @@ -166,10 +168,17 @@ Some user shares packages on his personal site but without create metadata files To install one of these packages you should download it and install manually. Now you can specify a direct url for the package with slackpkg+ that automatically will download and install/upgrade the package. +You can: +1) install/upgrade/reinstall a single package by passing the full url: # slackpkg install http://site/path/package-1.0-noarch-1my.txz - You may use that function to install a snapshot of slackpkg+ (that is not available with slackpkg upgrade slackpkg becouse is a beta) -# slackpg upgrade http://www.slakfinder.org/slackpkg+/pkg/slackpkg+-20130905.2-noarch-1mt.txz +# slackpkg upgrade http://www.slakfinder.org/slackpkg+/pkg/slackpkg+-20130905.2-noarch-1mt.txz +2) install/upgrade/reinstall all file packages in a single remote directory (does not allow subtree): +At the same of 'slackpkg install dir:..' syntax, you can specify a url-path: +# slackpkg install http://site/path/ +even if the site owner does not create metadata. +That function require lftp and may fail if the server does not supports Directory Listing or if there is a index.html in path. + NOTE: slackpkg+ will skip the gpg and md5 check!! diff --git a/src/slackpkgplus.sh b/src/slackpkgplus.sh index 50af15f..932dc84 100755 --- a/src/slackpkgplus.sh +++ b/src/slackpkgplus.sh @@ -495,7 +495,7 @@ if [ "$SLACKPKGPLUS" = "on" ];then if [ ${localpath:0:1} != "/" ];then localpath=$(pwd)/$localpath fi - repository=file$(grep ^SLACKPKGPLUS_file ${TMPDIR}/pkglist-pre|wc -l) + repository=file$(grep ^SLACKPKGPLUS_file ${TMPDIR}/pkglist-pre|awk '{print $1}'|uniq|wc -l) echo "./SLACKPKGPLUS_$repository/$package"|awk -f /usr/libexec/slackpkg/pkglist.awk >> ${TMPDIR}/pkglist-pre MIRRORPLUS[$repository]="file:/$localpath/" PRIORITYLIST=( ${PRIORITYLIST[*]} SLACKPKGPLUS_${repository}:$package ) @@ -508,7 +508,7 @@ if [ "$SLACKPKGPLUS" = "on" ];then if [ ! -d "$localpath" ];then continue fi - repository=dir$(grep ^SLACKPKGPLUS_dir ${TMPDIR}/pkglist-pre|wc -l) + repository=dir$(grep ^SLACKPKGPLUS_dir ${TMPDIR}/pkglist-pre||awk '{print $1}'|uniqwc -l) if [ ${localpath:0:1} != "/" ];then localpath=$(pwd)/$localpath fi @@ -524,7 +524,7 @@ if [ "$SLACKPKGPLUS" = "on" ];then # without manual download. You can use http,https,ftp repositories elif echo "$pref" | egrep -q "^(https?|ftp)://.*/.*-[^-]+-[^-]+-[^\.]+\.t.z$" ;then repository=$(echo "$pref" | cut -f1 -d":") - repository=$repository$(grep ^SLACKPKGPLUS_$repository[0-9] ${TMPDIR}/pkglist-pre|wc -l) + repository=$repository$(grep ^SLACKPKGPLUS_$repository[0-9] ${TMPDIR}/pkglist-pre|awk '{print $1}'|uniq|wc -l) MIRRORPLUS[$repository]=$(dirname $pref)"/" package=$(basename $pref) echo "./SLACKPKGPLUS_$repository/$package"|awk -f /usr/libexec/slackpkg/pkglist.awk >> ${TMPDIR}/pkglist-pre @@ -532,6 +532,16 @@ if [ "$SLACKPKGPLUS" = "on" ];then REPOPLUS=( ${repository} ${REPOPLUS[*]} ) package=$(cutpkg $package) + # You can specify 'slackpkg install http://mysite.org/myrepo' to list remote directory + elif echo "$pref" | egrep -q "^(https?|ftp)://.*/.*" ;then + repository=$(echo "$pref" | cut -f1 -d":") + repository=$repository$(grep ^SLACKPKGPLUS_$repository[0-9] ${TMPDIR}/pkglist-pre|awk '{print $1}'|uniq|wc -l) + lftp $pref -e "ls;quit" 2>/dev/null|awk '{print $NF}'|egrep '^.*-[^-]+-[^-]+-[^\.]+\.t.z$'|tac| \ + awk '{print "./SLACKPKGPLUS_'$repository'/"$NF}'|awk -f /usr/libexec/slackpkg/pkglist.awk >> ${TMPDIR}/pkglist-pre + MIRRORPLUS[$repository]=$(echo "$pref" |sed 's_/$__')"/" + PRIORITYLIST=( ${PRIORITYLIST[*]} SLACKPKGPLUS_${repository}:.* ) + REPOPLUS=( ${repository} ${REPOPLUS[*]} ) + package=SLACKPKGPLUS_$repository # You can specify 'slackpkg install reponame:packagename' elif echo "$pref" | grep -q "[a-zA-Z0-9]\+[:][a-zA-Z0-9]\+" ; then