From 8793c8d00999b8dc27f4ca0b0398e6850b27b5c1 Mon Sep 17 00:00:00 2001 From: rhatto Date: Sun, 10 Dec 2006 23:32:42 +0000 Subject: simplaret: simplaret_search_and_download_patch fix git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@72 04377dda-e619-0410-9926-eae83683ac58 --- src/simplaret | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/simplaret b/src/simplaret index 2d39dbe..581660f 100755 --- a/src/simplaret +++ b/src/simplaret @@ -439,24 +439,24 @@ function simplaret_search_and_download_patch { local package_version package_build # get just the file name - candidate="`echo $candidate | cut -d , -f 1`" + sugested="`echo $sugested | 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`" + package_version="`package_version $sugested`" + package_build="`package_build $sugested`" + sugested="`package_name $sugested`" # check if the patch was already downloaded - if echo $DOWNLOADED_PATCHES | grep -q " $candidate "; then + if echo $DOWNLOADED_PATCHES | grep -q " $sugested "; then return fi # search if its installed in the jail - installed_packs="`ls /$root/var/log/packages/$candidate* 2> /dev/null`" + installed_packs="`ls /$root/var/log/packages/$sugested* 2> /dev/null`" if [ ! -z "$installed_packs" ]; then for installed in $installed_packs; do - if [[ "$candidate" == "`package_name $installed.tgz`" ]]; then + if [[ "$sugested" == "`package_name $installed.tgz`" ]]; then package_installed="1" break fi @@ -464,10 +464,10 @@ function simplaret_search_and_download_patch { # if the package is installed, download the patch if [[ "$package_installed" == "1" ]]; then - # TODO: verificar se eh a mesma versao e build number que esta instalada? - # DOWNLOAD_EVEN_IF_APPLIED? - simplaret_get $candidate - DOWNLOADED_PATCHES="$DOWNLOADED_PATCHES $candidate " # the ending space is important + simplaret_get $sugested + if [ "$?" == "0" ]; then + DOWNLOADED_PATCHES="$DOWNLOADED_PATCHES $sugested " # the ending space is important + fi fi fi @@ -507,18 +507,18 @@ function simplaret_get_jail_patches { echo fetching patches for arch $ARCH and version $VERSION for jail $root # list all available patches in PATCHES repositories - for candidate in `simplaret_search -formatted | grep patches`; do + for sugested in `simplaret_search -formatted | grep patches`; do simplaret_search_and_download_patch done # list all available patches in ROOT repositories - for candidate in `simplaret_search patches -formatted | grep root`; do + for sugested in `simplaret_search patches -formatted | grep root`; do simplaret_search_and_download_patch done # grab patches from every other places if [ "$CONSIDER_ALL_PACKAGES_AS_PATCHES" == "1" ]; then - for candidate in `simplaret_search patches -formatted | grep -v patches | grep -v root`; do + for sugested in `simplaret_search patches -formatted | grep -v patches | grep -v root`; do simplaret_search_and_download_patch done fi -- cgit v1.2.3