X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=util-vserver%2Fscripts%2Fvserver-build;h=980ca5aa4841bb209576fc59764e662fd1e0b3d3;hb=95cf3519da76f335389cd7a18d0090b59f81f2e7;hp=2f450905245bf76a90a48a500a6f1a491f2b59e8;hpb=61b371f392da6ef2aa205d96358a8eda885e5993;p=util-vserver.git diff --git a/util-vserver/scripts/vserver-build b/util-vserver/scripts/vserver-build index 2f45090..980ca5a 100755 --- a/util-vserver/scripts/vserver-build +++ b/util-vserver/scripts/vserver-build @@ -16,9 +16,9 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -: ${UTIL_VSERVER_VARS:=$(dirname $0)/util-vserver-vars} +: ${UTIL_VSERVER_VARS:=/usr/lib/util-vserver/util-vserver-vars} test -e "$UTIL_VSERVER_VARS" || { - echo "Can not find util-vserver installation; aborting..." + echo $"Can not find util-vserver installation (the file '$UTIL_VSERVER_VARS' would be expected); aborting..." >&2 exit 1 } . "$UTIL_VSERVER_VARS" @@ -38,9 +38,9 @@ Options: --force ... remove/rename already existing vservers with the same name -m ... use method ; see below for possible values --rootdir - ... [default: /vservers] + ... [default: $DEFAULT_VSERVERDIR] --pkgcfgbase - ... [default: /.pkg] + ... [default: $DEFAULT_VSERVERPKGDIR] cfg-options are: $SETUP_HELPMSG @@ -50,9 +50,14 @@ Possible methods are: cfg-options will be ignored copy ... the copy-all-from-host method which uses the recent configuration scheme - apt-rpm -d + apt-rpm ... -- -d ... installs the base-packages of the given distribution with help of 'vapt-get' + skeleton ... -- [ *] + ... installs a minimal skeleton filesystem, creates the + configuration file and calls an optional command then + debootstrap ... -- -d [-m ] + bootstraps the vserver with Debian's 'debootstrap' package Please report bugs to $PACKAGE_BUGREPORT" exit 0 @@ -75,9 +80,9 @@ the GNU General Public License. This program has absolutely no warranty." set -e declare -a default_opts=() -test "$NO_DEFAULT_OPTS" || getFileArray default_opts "$CONFDIR/.defaults/apps/build/options" +test "$NO_DEFAULT_OPTS" || getFileArray default_opts "$CONFDIR/.defaults/apps/build/options" || : -tmp=$(getopt -o +m:n: --long force,debug,help,version,rootdir:,pkgbase:,$SETUP_OPTIONS -n "$0" -- \ +tmp=$(getopt -o +m:n: --long force,debug,help,version,rootdir:,pkgbase:,$SETUP_OPTIONS -n "$(basename $0)" -- \ "${default_opts[@]}" "$@") || exit 1 eval set -- "$tmp" @@ -86,18 +91,18 @@ OPTION_FORCE= while true; do case "$1" in - --help) showHelp $0 ;; - --version) showVersion ;; - --force) OPTION_FORCE=1;; - --debug) set -x;; - --rootdir) ROOTDIR=$2; shift;; - --pkgbase) PKGCFGBASE=$2; shift;; - -m) method=$2; shift;; - -n) VSERVER_NAME=$2; shift;; - --) shift; break;; - *) + (--help) showHelp $0 ;; + (--version) showVersion ;; + (--force) OPTION_FORCE=1;; + (--debug) set -x;; + (--rootdir) ROOTDIR=$2; shift;; + (--pkgbase) PKGCFGBASE=$2; shift;; + (-m) method=$2; shift;; + (-n) VSERVER_NAME=$2; shift;; + (--) shift; break;; + (*) { setup_setOption2 "$1" "$2" && shift; } || \ - { echo $"vserver-build: internal error."; exit 1; } + { echo $"vserver-build: internal error."; exit 1; } >&2 ;; esac shift @@ -106,19 +111,19 @@ done test "$VSERVER_NAME" || { echo $"Name of vserver not specified" exit 1 -} +} >&2 setup_setDefaults "$VSERVER_NAME" case x"$method" in - xlegacy) exec $_VSERVER_LEGACY "$VSERVER_NAME" build "$@" ;; - xapt-rpm|xcopy) + (xlegacy) exec $_VSERVER_LEGACY "$VSERVER_NAME" build "$@" ;; + (xapt-rpm|xcopy|xskeleton|xdebootstrap) . $PKGLIBDIR/vserver-build.$method ;; - x) echo $"No build-method specified" >&2 + (x) echo $"No build-method specified" >&2 exit 1 ;; - *) echo $"Unknown build-method '$method'" >&2 + (*) echo $"Unknown build-method '$method'" >&2 exit 1 ;; esac