From 08f6375bf7e7257ab32afdb48a81b26fbc225ed7 Mon Sep 17 00:00:00 2001 From: rhatto Date: Thu, 1 Feb 2007 00:05:20 +0000 Subject: verbose enhancements git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@143 04377dda-e619-0410-9926-eae83683ac58 --- src/simplaret | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/simplaret b/src/simplaret index f2d2ebd..01dad09 100755 --- a/src/simplaret +++ b/src/simplaret @@ -38,7 +38,6 @@ function simplaret_usage { function simplaret_get_index { for file in `simplaret_metafiles`; do - echo getting $1/$file: simplaret_download $1 $file $2 --no-verbose done @@ -95,7 +94,9 @@ function simplaret_download { curl_verbose="-#" fi + if [ "$protocol" == "http" ]; then + echo Getting $1/$file: if [ "$HTTP_TOOL" == "wget" ]; then wget $wget_timeout $wget_verbose $1/$2 -O $3/$file elif [ "$HTTP_TOOL" == "curl" ]; then @@ -106,6 +107,7 @@ function simplaret_download { exit 1 fi elif [ "$protocol" == "ftp" ]; then + echo Getting $1/$file: if [ "$PASSIVE_FTP" == "1" ]; then wget_passive_ftp="--passive-ftp" ncftpget_passive_ftp="-F" @@ -124,14 +126,17 @@ function simplaret_download { fi elif [ "$protocol" == "file" ]; then url="`echo $1 | sed -e 's/file:\/\///'`" + if [ -f "$3/$file" ]; then + rm -f $3/$file + fi + echo -n "Copying $url/$2..." if [ -f "$url/$2" ]; then - echo -n "Copying $url/$2..." cp $url/$2 $3/$file 2> /dev/null - if [ "$?" == "0" ]; then - echo " done." - else - echo " failed." - fi + fi + if [ -f "$3/$file" ]; then + echo " done." + else + echo " failed." fi fi @@ -425,7 +430,7 @@ function simplaret_search_and_delete { [ "`package_build $candidate`" == "`package_build $result`" ]; then if [ "$3" != "--silent" ]; then echo package $candidate already downloaded - echo package $candidate stored at `dirname $file` + # echo package $candidate stored at `dirname $file` else echo $file fi return 1 -- cgit v1.2.3