function simplaret_search_and_download_patch {
+ local package_version package_build
+
+ # get just the file name
candidate="`basename $(echo $candidate | cut -d , -f 1)`"
+ # now split the file name into pieces
+ package_version="`package_version $candidate`"
+ package_build="`package_build $candidate`"
+ candidate="`package_name $candidate`"
+
# check if the patch was already downloaded
if echo $DOWNLOADED_PATCHES | grep -q " $candidate "; then
return
if [ ! -z "$installed_packs" ]; then
for installed in $installed_packs; do
- if [[ "`package_name $candidate`" == "`package_name $installed.tgz`" ]]; then
+ if [[ "$candidate" == "`package_name $installed.tgz`" ]]; then
package_installed="1"
break
fi
if [[ "$package_installed" != "1" ]]; then
# TODO: verificar se eh a mesma versao e build number?
# DOWNLOAD_EVEN_IF_APPLIED?
- simplaret_get `package_name $candidate`
+ simplaret_get $candidate
DOWNLOADED_PATCHES="$DOWNLOADED_PATCHES $candidate " # the ending space is important
fi