diff options
Diffstat (limited to 'src/simplaret')
-rwxr-xr-x | src/simplaret | 17 |
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 |