aboutsummaryrefslogtreecommitdiff
path: root/src/jail-upgrade
diff options
context:
space:
mode:
authorrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>2006-11-13 01:06:04 +0000
committerrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>2006-11-13 01:06:04 +0000
commite84a823cf917ac13db1bbd8e52072196b894e2a8 (patch)
treed15cfc7dc55b7e0b72a37fd13e054e61b8e183a7 /src/jail-upgrade
parent8164018d0940b8cc542cb5995a1e7c85187bbdb7 (diff)
downloadsimplepkg-e84a823cf917ac13db1bbd8e52072196b894e2a8.tar.gz
simplepkg-e84a823cf917ac13db1bbd8e52072196b894e2a8.tar.bz2
changing jail-upgrade behavior
git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@26 04377dda-e619-0410-9926-eae83683ac58
Diffstat (limited to 'src/jail-upgrade')
-rwxr-xr-xsrc/jail-upgrade19
1 files changed, 15 insertions, 4 deletions
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 /