From f8bd3a97cef79f3c19551666dc073e832700371d Mon Sep 17 00:00:00 2001 From: rhatto Date: Sun, 26 Aug 2007 16:04:15 +0000 Subject: - more simplaret_search_and_process_patch enhancements - common.sh: new package_name replaces the old pkgtool package_name function git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@430 04377dda-e619-0410-9926-eae83683ac58 --- trunk/src/simplaret | 56 ++++++++++++++++++++++++++--------------------------- 1 file changed, 28 insertions(+), 28 deletions(-) (limited to 'trunk/src/simplaret') diff --git a/trunk/src/simplaret b/trunk/src/simplaret index 54b8f0e..29e3b75 100755 --- a/trunk/src/simplaret +++ b/trunk/src/simplaret @@ -691,36 +691,36 @@ function simplaret_search_and_process_patch { local package_version package_build installed_version pack local installed_build repos_type get is_patch package_match - # get the repository type - repos_type="`echo $sugested | cut -d , -f 2`" + # get just the file and package name + sugested_filename="`echo $sugested | cut -d , -f 1`" + sugested_pack="`package_name $sugested_filename`" - # get just the file name - sugested="`echo $sugested | cut -d , -f 1`" + # search if its installed in the jail + if grep -q -e "^$sugested_pack$" $PACKAGES_TMP; then + + # get the repository type + repos_type="`echo $sugested | cut -d , -f 2`" - if echo $sugested | grep -q "patches"; then - is_patch="yes" - else - is_patch="no" - fi + 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`" - sugested="`package_name $sugested`" + # now split the file name into pieces + package_version="`package_version $sugested_filename`" + package_build="`package_build $sugested_filename`" - # check if the patch was already downloaded - if echo "$DOWNLOADED_PATCHES" | grep -q " $ARCH:$VERSION:$sugested "; then - if [ "$IS_UPGRADE" != "1" ]; then - echo Package $sugested already downloaded - # echo "Jail $root needs package $sugested (already downloaded, skipping)" - return + # check if the patch was already downloaded + if echo "$DOWNLOADED_PATCHES" | grep -q " $ARCH:$VERSION:$sugested_pack "; then + if [ "$IS_UPGRADE" != "1" ]; then + echo Package $sugested_pack already downloaded + # echo "Jail $root needs package $sugested_pack (already downloaded, skipping)" + return + fi fi - fi - # search if its installed in the jail - if grep -q -e "^$sugested$" $PACKAGES_TMP; then - - pack="`echo $sugested | sed -e 's/\+/\\\+/'`" + pack="`echo $sugested_pack | sed -e 's/\+/\\\+/'`" installed=`eval "ls $root/var/log/packages/ | egrep -E '^$pack-[^-]+-[^-]+-[^-]+$'"` installed_version="`package_version $installed.tgz`" installed_build="`package_build $installed.tgz`" @@ -760,15 +760,15 @@ function simplaret_search_and_process_patch { if [ "$get" == "yes" ]; then if [ "$IS_UPGRADE" == "1" ]; then if [ "$package_match" == "no" ]; then - simplaret_install $sugested + simplaret_install $sugested_pack else - simplaret_get $sugested + simplaret_get $sugested_pack fi else - simplaret_get $sugested + simplaret_get $sugested_pack fi if [ "$?" == "0" ]; then - DOWNLOADED_PATCHES="$DOWNLOADED_PATCHES $ARCH:$VERSION:$sugested " # the ending space is important + DOWNLOADED_PATCHES="$DOWNLOADED_PATCHES $ARCH:$VERSION:$sugested_pack " # the ending space is important fi fi -- cgit v1.2.3