simplaret_download $repository_url $file $folder
if [ ! -f "$folder/$candidate" ]; then
+ LAST_DONWLOADED_PACKAGE="0"
if [ "$2" != "--silent" ]; then
echo Error downloading $candidate from $repos_type repository $repository_url, please check your settings
fi
return 1
else
+ LAST_DONWLOADED_PACKAGE="$folder/$candidate"
if [ "$2" != "--silent" ]; then
silent=""
echo Package $candidate stored at $folder
else
- echo $folder/$candidate
+ # echo $folder/$candidate
silent="--silent"
fi
simplaret_checksum $storage/$repository_name/CHECKSUMS.md5 $folder/$candidate $silent
fi
fi
- package="`simplaret_get $1 --silent`"
+ # package="`simplaret_get $1 --silent`"
+ simplaret_get $1 --silent
+ package="$LAST_DONWLOADED_PACKAGE"
- if [ "$?" == "0" ] && [ ! -z "$package" ]; then
+ if [ "$package" != "0" ] && [ ! -z "$package" ]; then
if [ -f "$package" ]; then
ROOT=$root upgradepkg --install-new $package
+ LAST_DONWLOADED_PACKAGE="0"
else
echo "error: could not install package $1: file not found"
+ LAST_DONWLOADED_PACKAGE="0"
return 1
fi
else
echo "error: could not install package $1"
+ LAST_DONWLOADED_PACKAGE="0"
return 1
fi