aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>2007-01-27 21:42:47 +0000
committerrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>2007-01-27 21:42:47 +0000
commit964e94af811e34a0b86b73934e572bf0c9668735 (patch)
tree598e8dd3566901764bb06e9e249b29359cd391f0 /src
parenta5798656b60e286884de9ad38a8d3824d95b2097 (diff)
downloadsimplepkg-964e94af811e34a0b86b73934e572bf0c9668735.tar.gz
simplepkg-964e94af811e34a0b86b73934e572bf0c9668735.tar.bz2
simplepkg 0.4.9pre12
git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@129 04377dda-e619-0410-9926-eae83683ac58
Diffstat (limited to 'src')
-rwxr-xr-xsrc/simplaret16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/simplaret b/src/simplaret
index 500e456..d3dc24f 100755
--- a/src/simplaret
+++ b/src/simplaret
@@ -87,16 +87,16 @@ function simplaret_download {
fi
if [ "$protocol" == "http" ]; then
- (cd $3 && wget $wget_timeout $1/$2)
+ wget $wget_timeout $1/$2 -O $3/$2
elif [ "$protocol" == "ftp" ]; then
if [ "$PASSIVE_FTP" == "1" ]; then
wget_passive_ftp="--passive-ftp"
ncftpget_passive_ftp="-F"
fi
if [ "$FTP_TOOL" == "ncftpget" ]; then
- (cd $3 && ncftpget $ncftpget_timeout $ncftpget_passive_ftp $1/$2)
+ ncftpget -c $ncftpget_timeout $ncftpget_passive_ftp $1/$2 > $3/$2
elif [ "$FTP_TOOL" == "wget" ]; then
- (cd $3 && wget $wget_timeout $wget_passive_ftp $1/$2)
+ wget $wget_timeout $wget_passive_ftp $1/$2 -O $3/$2
else
echo $BASENAME: error: invalid value for config variable FTP_TOOL: $FTP_TOOL
echo $BASENAME: please check your config file $CONF
@@ -104,7 +104,15 @@ function simplaret_download {
fi
elif [ "$protocol" == "file" ]; then
url="`echo $1 | sed -e 's/file:\/\///'`"
- cp $url/$2 $3 2> /dev/null
+ if [ -f "$url/$2" ]; then
+ echo -n "Copying $url/$2..."
+ cp $url/$2 $3/$2 2> /dev/null
+ if [ "$?" == "0" ]; then
+ echo " done."
+ else
+ echo " failed."
+ fi
+ fi
fi
}