Do not install a local helper package by default
authorNikos Skalkotos <skalkoto@grnet.gr>
Fri, 30 Nov 2012 13:29:45 +0000 (15:29 +0200)
committerNikos Skalkotos <skalkoto@grnet.gr>
Fri, 30 Nov 2012 13:29:45 +0000 (15:29 +0200)
snf-image-update-helper will only install a pkg retrieved from the
apt unless -p option is specified.

snf-image-host/common.sh.in
snf-image-host/defaults
snf-image-host/snf-image-update-helper.in

index c230d20..4d59f55 100644 (file)
@@ -369,7 +369,6 @@ fi
 : ${HELPER_IMG:="@HELPER_IMG@"}
 : ${HELPER_KERNEL:="@HELPER_KERNEL@"}
 : ${HELPER_INITRD:="@HELPER_INITRD@"}
-: ${HELPER_PKG:="@HELPER_DIR@/snf-image-helper.deb"}
 : ${HELPER_SOFT_TIMEOUT:=20}
 : ${HELPER_HARD_TIMEOUT:=5}
 : ${HELPER_USER:="nobody"}
index c8b384f..82d896d 100644 (file)
@@ -32,9 +32,6 @@
 # HELPER_INITRD: Path to the helper VM initial ramdisk
 # HELPER_INITRD="${HELPER_DIR}/initrd"
 
-# HELPER_PKG: Path to the snf-image-helper package
-# HELPER_PKG="${HELPER_DIR}/snf-image-helper.deb"
-
 # HELPER_TIMOUT: Soft and hard timeout limits for helper instance.
 # The helper instance will be terminated after a given time if it hasn't exited
 # by itself. A TERM signal will be send if the instance is running after
index eef3e4a..b10f2b3 100644 (file)
@@ -43,7 +43,6 @@ OPTIONS:
 
     -p PACKAGE
         Install this deb package in the helper image, instead of the default
-        [default: $HELPER_PKG]
 
     -r  Don't use any existing cache
 
@@ -182,10 +181,8 @@ rm "$target/vmlinuz" "$target/initrd.img"
 
 pkg_installed=$(grep snf-image-helper "$HELPER_DIR/packages" > /dev/null && echo yes)
 
-if [ ! -r "$HELPER_PKG" -a -z "$pkg_installed" ]; then
-    log_error "ERROR:"
-    log_error "Helper package \`$HELPER_PKG' does not exist or is not" \
-    "readable by the script."
+if [ -z "$HELPER_PKG" -a -z "$pkg_installed" ]; then
+    log_error "No helper package was specified and non was found by the apt."
     exit 1
 fi
 
@@ -202,7 +199,7 @@ else
     echo "snf-image-helper pkg was installed from the apt repository."
 fi
 
-if [ "$VERSION_CHECK" == yes ]; then
+if [ "$VERSION_CHECK" == yes -a -z "$HELPER_PKG" ]; then
     helper_version="$(grep ^snf-image-helper[[:space:]] "$HELPER_DIR/packages" | cut -f2)"
     host_version="$(dpkg-query -W -f "\${Version}\n" snf-image-host)"
     if [ "$host_version" != "$helper_version" ]; then