From 25f8514c330b0b81691aba42cea6a55b1e5d1e4d Mon Sep 17 00:00:00 2001 From: rhatto Date: Tue, 30 Jan 2007 17:44:48 +0000 Subject: simplepkg 0.4.9pre15 git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@132 04377dda-e619-0410-9926-eae83683ac58 --- src/simplaret | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/simplaret b/src/simplaret index b58e41b..075cd7c 100755 --- a/src/simplaret +++ b/src/simplaret @@ -71,11 +71,12 @@ function simplaret_download { # download a file from a repo to a folder # usage: simplaret - local protocol + local protocol file local wget_timeout wget_passive_ftp local ncftpget_timeout ncftpget_passive_ftp protocol="`echo $1 | cut -d : -f 1`" + file="`basename $2`" if [ ! -d "$3" ]; then mkdir -p $3 @@ -87,16 +88,16 @@ function simplaret_download { fi if [ "$protocol" == "http" ]; then - wget $wget_timeout $1/$2 -O $3/$2 + wget $wget_timeout $1/$2 -O $3/$file elif [ "$protocol" == "ftp" ]; then if [ "$PASSIVE_FTP" == "1" ]; then wget_passive_ftp="--passive-ftp" ncftpget_passive_ftp="-F" fi if [ "$FTP_TOOL" == "ncftpget" ]; then - ncftpget -c $ncftpget_timeout $ncftpget_passive_ftp $1/$2 > $3/$2 + ncftpget -c $ncftpget_timeout $ncftpget_passive_ftp $1/$2 > $3/$file elif [ "$FTP_TOOL" == "wget" ]; then - wget $wget_timeout $wget_passive_ftp $1/$2 -O $3/$2 + wget $wget_timeout $wget_passive_ftp $1/$2 -O $3/$file else echo $BASENAME: error: invalid value for config variable FTP_TOOL: $FTP_TOOL echo $BASENAME: please check your config file $CONF @@ -106,7 +107,7 @@ function simplaret_download { url="`echo $1 | sed -e 's/file:\/\///'`" if [ -f "$url/$2" ]; then echo -n "Copying $url/$2..." - cp $url/$2 $3/$2 2> /dev/null + cp $url/$2 $3/$file 2> /dev/null if [ "$?" == "0" ]; then echo " done." else -- cgit v1.2.3