cached_downloader now works with check-updates too.

check-updates when running with VERBOSE=3 shows downloader outputs.
This commit is contained in:
Matteo Rossini 2016-01-24 12:51:22 +01:00
parent 9162eb58f5
commit 3f16140eeb

View file

@ -357,7 +357,7 @@ if [ "$SLACKPKGPLUS" = "on" ];then
case $SRCBASE in case $SRCBASE in
CHECKSUMS.md5|CHECKSUMS.md5.asc) TOCACHE=1 ; CURREPO=$(basename $1|sed -r -e "s/CHECKSUMS.md5-?//" -e "s/\.asc//") ;; CHECKSUMS.md5|CHECKSUMS.md5.asc) TOCACHE=1 ; CURREPO=$(basename $1|sed -r -e "s/CHECKSUMS.md5-?//" -e "s/\.asc//") ;;
MANIFEST.bz2|PACKAGES.TXT) TOCACHE=1 ; CURREPO=$(basename $1|sed -e "s/-$SRCBASE//" -e "s/SLACKPKGPLUS_//");; MANIFEST.bz2|PACKAGES.TXT) TOCACHE=1 ; CURREPO=$(basename $1|sed -e "s/-$SRCBASE//" -e "s/SLACKPKGPLUS_//");;
ChangeLog.txt) TOCACHE=0 ;; ChangeLog.txt) TOCACHE=1 ;;
GPG-KEY) TOCACHE=0 ; CURREPO=${1/*gpgkey-tmp-/};; GPG-KEY) TOCACHE=0 ; CURREPO=${1/*gpgkey-tmp-/};;
FILELIST.TXT) TOCACHE=1 ;; FILELIST.TXT) TOCACHE=1 ;;
esac esac
@ -383,15 +383,15 @@ if [ "$SLACKPKGPLUS" = "on" ];then
return $? return $?
fi fi
echo -n ". " # ... .. -> cache older or corrupted echo -n ". " # ... .. -> cache older or corrupted
rm -f $CACHEDIR/$CACHEFILE $CACHEDIR/$CACHEFILE.head rm -f $CACHEDIR/$CACHEFILE $CACHEDIR/$CACHEFILE.head 2>/dev/null
fi fi
echo " Downloading... " # ... -> needed # ... .. -> re-needed echo " Downloading... " # ... -> needed # ... .. -> re-needed
$CACHEDOWNLOADER $1 $SRCURL $CACHEDOWNLOADER $1 $SRCURL
ERR=$? ERR=$?
echo echo
if [ "$(ls -l $1 2>/dev/null|awk '{print $5}')" == "$(grep Content-Length: $TMPDIR/cache.head|awk '{print $2}')" ];then if [ "$(ls -l $1 2>/dev/null|awk '{print $5}')" == "$(grep Content-Length: $TMPDIR/cache.head|awk '{print $2}')" ];then
cp $1 $CACHEDIR/$CACHEFILE cp $1 $CACHEDIR/$CACHEFILE 2>/dev/null
cp $TMPDIR/cache.head $CACHEDIR/$CACHEFILE.head cp $TMPDIR/cache.head $CACHEDIR/$CACHEFILE.head 2>/dev/null
fi fi
else else
echo " Downloading..." # .. -> tocache=0 echo " Downloading..." # .. -> tocache=0
@ -1186,6 +1186,8 @@ if [ "$SLACKPKGPLUS" = "on" ];then
### =========================== MAIN ============================ ### ### =========================== MAIN ============================ ###
export LC_ALL=C
if [ "$DOWNLOADONLY" == "on" ];then if [ "$DOWNLOADONLY" == "on" ];then
DELALL=off DELALL=off
DOWNLOAD_ALL=on DOWNLOAD_ALL=on
@ -1342,7 +1344,7 @@ if [ "$SLACKPKGPLUS" = "on" ];then
fi fi
fi fi
if [ "$CMD" == "update" -a "$CACHEUPDATE" == "on" ];then if [ "$CACHEUPDATE" == "on" ]&&[ "$CMD" == "update" -o "$CMD" == "check-updates" ];then
CACHEDOWNLOADER=$DOWNLOADER CACHEDOWNLOADER=$DOWNLOADER
CACHEDIR=$WORKDIR/cache CACHEDIR=$WORKDIR/cache
mkdir -p $CACHEDIR mkdir -p $CACHEDIR
@ -1615,8 +1617,12 @@ if [ "$SLACKPKGPLUS" = "on" ];then
echo -n "" > ~/.slackpkg/updated-repos.txt echo -n "" > ~/.slackpkg/updated-repos.txt
UPDATES=false UPDATES=false
if [ $VERBOSE -eq 3 ];then
if ! checkchangelog 1>/dev/null 2>/dev/null; then checkchangelog
else
checkchangelog >/dev/null 2>&1
fi
if [ $? -ne 0 ]; then
# -- Note: # -- Note:
# checkchangelog() download the ChangeLog.txt and stores it # checkchangelog() download the ChangeLog.txt and stores it