aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>2007-01-23 20:44:21 +0000
committerrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>2007-01-23 20:44:21 +0000
commit768634c2a0cf9245ed1b3be5d48ba41062d0ad63 (patch)
treec7e6de3a7aaa3f7b973c2231e2aa77cf5c38b9d1
parent9f5d2fe4db2664b2a656ecdf43a1ccba94723c1c (diff)
downloadsimplepkg-768634c2a0cf9245ed1b3be5d48ba41062d0ad63.tar.gz
simplepkg-768634c2a0cf9245ed1b3be5d48ba41062d0ad63.tar.bz2
simplaret: now --install can check if version and arch matches the jail ones
git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@122 04377dda-e619-0410-9926-eae83683ac58
-rwxr-xr-xsrc/simplaret17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/simplaret b/src/simplaret
index 8e2a53b..42f1bff 100755
--- a/src/simplaret
+++ b/src/simplaret
@@ -683,12 +683,27 @@ function simplaret_checksum {
function simplaret_install {
# download and install a package
+ # usage: simplaret_install <package-name> [--skip-checks]
- local package root
+ local package root jail_arch jail_version
root="/$ROOT"
mkdir -p $root/var/log/setup/tmp
+ if [ "$2" != "--skip-checks" ]; then
+ jail_arch="`default_arch $root`"
+ jail_version="`default_version $root`"
+ if [ "$ARCH" != "$jail_arch" ]; then
+ echo "$BASENAME: requested repository arch ($ARCH) doesn't match jail arch ($jail_arch)"
+ echo "$BASENAME: please use \"$BASENAME --get $1 --skip-checks\" to ignore this warning and install anyway"
+ return
+ elif [ "$VERSION" != "$jail_version" ]; then
+ echo "$BASENAME: requested repository version ($VERSION) doesn't match jail version ($jail_version)"
+ echo "$BASENAME: please use \"$BASENAME --get $1 --skip-checks\" to ignore this warning and install anyway"
+ return 1
+ fi
+ fi
+
package="`simplaret_get $1 --silent`"
if [ "$?" == "0" ] && [ ! -z "$package" ]; then