fixed VLAN setup: set the name-type, honor the 'ip' value and use the
[util-vserver.git] / util-vserver / scripts / vserver-build.debootstrap
index 27fb8d2..a58c27c 100644 (file)
@@ -29,11 +29,11 @@ function init
 
 function initVariables
 {
-    base.initVariables
+    base.init
 
     test -n "${mirror-unset}" || {
        local aux
-       findFile aux "$CONFDIR"/.defaults/apps/debootstrap/mirror ''
+       findFile aux "$__CONFDIR"/.defaults/apps/debootstrap/mirror ''
        test -z "$aux" || read mirror <"$aux"
     }
 }
@@ -54,11 +54,14 @@ function findDebootstrap
         workdir=$dir
         dst=$dir/debootstrap.deb
         
-        findFile DEBOOTSTRAP_URI "$CONFDIR"/.defaults/apps/debootstrap/uri "$PKGLIBDEFAULTDIR"/debootstrap.uri
+        findFile DEBOOTSTRAP_URI "$__CONFDIR"/.defaults/apps/debootstrap/uri "$__PKGLIBDEFAULTDIR"/debootstrap.uri
         read tmp <$DEBOOTSTRAP_URI
         case "$tmp" in
        (/*)                    ln -s "$tmp" "$dst";;
        (http://*|ftp://*)
+           echo $"\
+Could not find local version of 'debootstrap'; downloading it from
+${tmp}..."
            $_WGET -nv -O "$dst" "$tmp" || {
                $_CAT <<EOF >&2
 ERROR: Could not download the debootstrap package from
@@ -73,7 +76,7 @@ to util-vserver and removed the known ones. To fix this, go to
 (or a nearby mirror) and search the URL for the most recent *.deb
 package matching your platform. Then, put this URL into
 
-   $CONFDIR/.defaults/apps/debootstrap/uri
+   $__CONFDIR/.defaults/apps/debootstrap/uri
 
 and retry the vserver-build command again.
 EOF
@@ -122,7 +125,7 @@ while true; do
     shift
 done
 
-getDistribution
+getDistribution '' 1
 
 initVariables  
 initFilesystem "$OPTION_FORCE"
@@ -137,3 +140,5 @@ mv "$VDIR"/dev "$VDIR"/dev.X
 "$DEBOOTSTRAP" "$@" "$DISTRIBUTION" "$VDIR" "$mirror" || :     ## HACK: ignore all errors...
 fixupDebian "$VDIR"
 test -z "$BUILD_INITPOST" || "$BUILD_INITPOST" "$SETUP_CONFDIR" "$UTIL_VSERVER_VARS"
+
+base.setSuccess