From e84a823cf917ac13db1bbd8e52072196b894e2a8 Mon Sep 17 00:00:00 2001 From: rhatto Date: Mon, 13 Nov 2006 01:06:04 +0000 Subject: changing jail-upgrade behavior git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@26 04377dda-e619-0410-9926-eae83683ac58 --- src/jail-upgrade | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'src/jail-upgrade') diff --git a/src/jail-upgrade b/src/jail-upgrade index df6e013..c879bfa 100755 --- a/src/jail-upgrade +++ b/src/jail-upgrade @@ -23,19 +23,19 @@ function swaret_jail_upgrade { echo upgrading jail $1... if [ ! -d "$PATCHES_DIR" ]; then - # cd $PATCHES_DIR - # for file in `ls *tgz`; do for file in `find $PATCHES_DIR -name *tgz`; do pack=`package_name $file` for installed in `ls $1/var/log/packages/$pack* 2> /dev/null`; do if [[ $pack == `package_name $installed.tgz` ]]; then if [[ "`basename $installed`" != "`basename $file .tgz`" ]]; then ROOT=$1 upgradepkg $file + UPGRADED="$UPGRADED $pack" fi fi done done fi + } function simplaret_jail_upgrade { @@ -50,14 +50,13 @@ function simplaret_jail_upgrade { fi if [ -d "$PATCHES_DIR/$ARCH/$VERSION" ]; then - # cd $PATCHES_DIR/$ARCH/$VERSION - # for file in `ls *tgz`; do for file in `find $PATCHES_DIR/$ARCH/$VERSION -name *tgz`; do pack=`package_name $file` for installed in `ls $1/var/log/packages/$pack* 2> /dev/null`; do if [[ "$pack" == "`package_name $installed.tgz`" ]]; then if [[ "`basename $installed`" != "`basename $file .tgz`" ]]; then ROOT=$1 upgradepkg $file + UPGRADED="$UPGRADED $pack" fi fi done @@ -66,6 +65,16 @@ function simplaret_jail_upgrade { echo error: cant upgrade for arch $ARCH and version $VERSION on $1: no such patch dir $PATCHES_DIR/$ARCH/$VERSION fi + if [ "$CONSIDER_ALL_PACKAGES_AS_PATCHES" == "YES" ] || + [ "$CONSIDER_ALL_PACKAGES_AS_PATCHES" == "1" ]; then + # TODO: search all packages in the repositories + # apply a patch if: + # - it hasnt already applied + # - has a different version from the current installed + # - has a different build number from the current installed + true + fi + } if [ -f "$COMMON" ]; then @@ -93,6 +102,8 @@ else exit 1 fi +UPGRADED="" + if [ -z "$1" ]; then if [ -d "/var/log/packages" ]; then $upgrade_method / -- cgit v1.2.3