]> gitweb.fluxo.info Git - simplepkg.git/commitdiff
verbose enhancements
authorrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>
Thu, 1 Feb 2007 00:05:20 +0000 (00:05 +0000)
committerrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>
Thu, 1 Feb 2007 00:05:20 +0000 (00:05 +0000)
git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@143 04377dda-e619-0410-9926-eae83683ac58

src/simplaret

index f2d2ebd396a2817065c2ec5721887c1b239dbcd4..01dad09a6e5d874100c141da92092bb9930edb8c 100755 (executable)
@@ -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