From 5f057cf540b6946a53ee76b9bf8e0c2cf82bdc41 Mon Sep 17 00:00:00 2001 From: rhatto Date: Fri, 12 Jan 2007 18:29:59 +0000 Subject: simplepkg.conf: updated simplaret: - added DOWNLOAD_EVEN_APPLIED_PATCHES - logic fix in simplaret_search_and_download_patch git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@99 04377dda-e619-0410-9926-eae83683ac58 --- src/simplaret | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/simplaret b/src/simplaret index f080748..83d2ea9 100755 --- a/src/simplaret +++ b/src/simplaret @@ -55,6 +55,7 @@ function simplaret_eval_config { ROOT_PRIORITY="`simplaret_eval_parameter ROOT_PRIORITY patches slackware extra testing pasture`" SIMPLARET_PURGE_WEEKS="`simplaret_eval_parameter SIMPLARET_PURGE_WEEKS 0`" CONSIDER_ALL_PACKAGES_AS_PATCHES="`simplaret_eval_parameter CONSIDER_ALL_PACKAGES_AS_PATCHES 0`" + DOWNLOAD_EVEN_APPLIED_PATCHES="`simplaret_eval_parameter DOWNLOAD_EVEN_APPLIED_PATCHES 0`" # now we place "patches" on the top of ROOT_PRIORITY ROOT_PRIORITY="patches `echo $ROOT_PRIORITY | sed -e 's/patches//'`" @@ -469,7 +470,7 @@ function simplaret_get { function simplaret_search_and_download_patch { local package_version package_build installed_version - local installed_build repos_type get + local installed_build repos_type get is_patch # get the repository type repos_type="`echo $sugested | cut -d , -f 2`" @@ -477,6 +478,12 @@ function simplaret_search_and_download_patch { # get just the file name sugested="`echo $sugested | cut -d , -f 1`" + if echo $sugested | grep -q "patches"; then + is_patch="yes" + else + is_patch="no" + fi + # now split the file name into pieces package_version="`package_version $sugested`" package_build="`package_build $sugested`" @@ -500,11 +507,26 @@ function simplaret_search_and_download_patch { fi done + get="no" + # if the package is installed, download the patch if [ "$package_installed" == "1" ]; then - if [ "$repos_type" == "patches" ] || [ "$repos_type" == "root" ]; then - # TODO: DOWNLOAD_EVEN_APPLIED_PATCHES - get="yes" + if [ "$repos_type" == "patches" ]; then + + if [ "$DOWNLOAD_EVEN_APPLIED_PATCHES" == "1" ]; then + get="yes" + elif [ "$package_version" != "$installed_version" ] || [ "$package_build" != "$installed_build" ]; then + get="yes" + fi + + elif [ "$repos_type" == "root" ] && [ "$is_patch" == "yes" ]; then + + if [ "$DOWNLOAD_EVEN_APPLIED_PATCHES" == "1" ]; then + get="yes" + elif [ "$package_version" != "$installed_version" ] || [ "$package_build" != "$installed_build" ]; then + get="yes" + fi + else # here, we're dealing with repositories other than ROOT and REPOS, # so we need to check if either version or build number are different, -- cgit v1.2.3