diff options
author | rhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58> | 2007-08-26 16:04:15 +0000 |
---|---|---|
committer | rhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58> | 2007-08-26 16:04:15 +0000 |
commit | f8bd3a97cef79f3c19551666dc073e832700371d (patch) | |
tree | f9336c54dedf1b12ad6fa168cfc9ae0bbecdd06f /trunk/src/simplaret | |
parent | 6c6b1f95c4d7d82c088bc2ac0a80a51828471e18 (diff) | |
download | simplepkg-f8bd3a97cef79f3c19551666dc073e832700371d.tar.gz simplepkg-f8bd3a97cef79f3c19551666dc073e832700371d.tar.bz2 |
- 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
Diffstat (limited to 'trunk/src/simplaret')
-rwxr-xr-x | trunk/src/simplaret | 56 |
1 files changed, 28 insertions, 28 deletions
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 |