diff options
author | rhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58> | 2007-01-30 17:44:48 +0000 |
---|---|---|
committer | rhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58> | 2007-01-30 17:44:48 +0000 |
commit | 25f8514c330b0b81691aba42cea6a55b1e5d1e4d (patch) | |
tree | 9520f5fb767064410b98c6f475e838560ec25443 /src | |
parent | 5162249f252036c9a01848bc2853adac71539bf3 (diff) | |
download | simplepkg-25f8514c330b0b81691aba42cea6a55b1e5d1e4d.tar.gz simplepkg-25f8514c330b0b81691aba42cea6a55b1e5d1e4d.tar.bz2 |
simplepkg 0.4.9pre15
git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@132 04377dda-e619-0410-9926-eae83683ac58
Diffstat (limited to 'src')
-rwxr-xr-x | src/simplaret | 11 |
1 files changed, 6 insertions, 5 deletions
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 <repository_url> <package> <destination-folder> - 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 |