aboutsummaryrefslogtreecommitdiff
path: root/src/simplaret
diff options
context:
space:
mode:
Diffstat (limited to 'src/simplaret')
-rwxr-xr-xsrc/simplaret19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/simplaret b/src/simplaret
index b77322e..adef9b8 100755
--- a/src/simplaret
+++ b/src/simplaret
@@ -554,7 +554,11 @@ function simplaret_search_and_download_patch {
# finally, get the package
if [ "$get" == "yes" ]; then
- simplaret_get $sugested
+ if [ "$S_UPGRADE" == "1" ]; then
+ simplaret_install $sugested
+ else
+ simplaret_get $sugested
+ fi
if [ "$?" == "0" ]; then
DOWNLOADED_PATCHES="$DOWNLOADED_PATCHES $ARCH:$VERSION:$sugested " # the ending space is important
fi
@@ -600,7 +604,6 @@ function simplaret_get_jail_patches {
echo fetching patches for arch $ARCH and version $VERSION for jail $root
# list all available patches from PATCHES and ROOT repositories
- # old behaviour: for sugested in `simplaret_search --formatted | grep patches`; do
for sugested in `simplaret_search --formatted | grep patches | grep -v ",repos," | grep -v ",noarch,"`; do
simplaret_search_and_download_patch
done
@@ -608,9 +611,6 @@ function simplaret_get_jail_patches {
# grab patches from every other places
if [ "$CONSIDER_ALL_PACKAGES_AS_PATCHES" == "1" ]; then
- # old behaviour was just one loop:
- # for sugested in `simplaret_search --formatted | grep -v patches`; do
-
for sugested in `simplaret_search --formatted | grep patches | grep ",repos," | grep ",noarch,"`; do
simplaret_search_and_download_patch
done
@@ -631,6 +631,10 @@ function simplaret_get_patches {
local jailpath
+ if [ "$1" == "--upgrade" ]; then
+ IS_UPGRADE="1"
+ fi
+
# first get patches from the root system
simplaret_get_jail_patches
@@ -691,10 +695,11 @@ function simplaret_install {
ROOT=$root upgradepkg --install-new $package
else
echo "error: could not install package $package: file not found"
+ return 1
fi
else
echo "error: could not install package $package"
- exit 1
+ return 1
fi
}
@@ -743,7 +748,7 @@ case $1 in
"--get-patches" | "get-patches") simplaret_get_patches ;;
"--purge" | "purge") shift ; simplaret_purge $* ;;
"--install" | "install") simplaret_install $2 ;;
- "--upgrade" | "upgrade") simplaret_get_patches ; jail-upgrade ;;
+ "--upgrade" | "upgrade") simplaret_get_patches --upgrade ;;
"--remove" | "remove") removepkg $2 ;;
*) simplaret_usage ;;
esac