X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=util-vserver%2Fscripts%2Fvserver-build;h=a51e163be19406a810acdfaa4e683aee47cb2a33;hb=bb95a260f18983e80abcad495bd224b386a705e1;hp=efe1117b6d6c2cf3daf0dbd340aa0e50c53091da;hpb=0cde5f56b50bd0a29196d327d3f44ec6a023f06d;p=util-vserver.git diff --git a/util-vserver/scripts/vserver-build b/util-vserver/scripts/vserver-build index efe1117..a51e163 100755 --- a/util-vserver/scripts/vserver-build +++ b/util-vserver/scripts/vserver-build @@ -1,7 +1,7 @@ #! /bin/bash # $Id$ -# Copyright (C) 2003 Enrico Scholz +# Copyright (C) 2003,2004,2005 Enrico Scholz # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -53,6 +53,11 @@ Possible methods are: apt-rpm ... -- -d ... installs the base-packages of the given distribution with help of 'vapt-get' + yum ... -- -d + ... installs the base-packages of the given distribution with + help of 'vyum' + rpm ... -- [-d ] --empty|([--force] [--nodeps] )+ + ... installs lists of rpm-packages skeleton ... -- [ *] ... installs a minimal skeleton filesystem, creates the configuration file and calls an optional command then @@ -69,7 +74,7 @@ function showVersion() $"vserver-build $PACKAGE_VERSION -- initializes a vserver This program is part of $PACKAGE_STRING -Copyright (C) 2003 Enrico Scholz +Copyright (C) 2003,2004,2005 Enrico Scholz This program is free software; you may redistribute it under the terms of the GNU General Public License. This program has absolutely no warranty." exit 0 @@ -80,7 +85,7 @@ 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 -n "$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 "$(basename $0)" -- \ "${default_opts[@]}" "$@") || exit 1 @@ -88,13 +93,14 @@ eval set -- "$tmp" VSERVER_NAME= OPTION_FORCE= +OPTION_DEBUG=0 while true; do case "$1" in (--help) showHelp $0 ;; (--version) showVersion ;; (--force) OPTION_FORCE=1;; - (--debug) set -x;; + (--debug) let ++OPTION_DEBUG; set -x;; (--rootdir) ROOTDIR=$2; shift;; (--pkgbase) PKGCFGBASE=$2; shift;; (-m) method=$2; shift;; @@ -102,28 +108,22 @@ while true; do (--) shift; break;; (*) { setup_setOption2 "$1" "$2" && shift; } || \ - { echo $"vserver-build: internal error."; exit 1; } >&2 + panic $"vserver-build: internal error." ;; esac shift done -test "$VSERVER_NAME" || { - echo $"Name of vserver not specified" - exit 1 -} >&2 +test -n "$VSERVER_NAME" || + panic $"Name of vserver not specified" setup_setDefaults "$VSERVER_NAME" case x"$method" in (xlegacy) exec $_VSERVER_LEGACY "$VSERVER_NAME" build "$@" ;; - (xapt-rpm|xcopy|xskeleton|xdebootstrap) + (xapt-rpm|xcopy|xskeleton|xdebootstrap|xyum|xrpm) . $PKGLIBDIR/vserver-build.$method ;; - (x) echo $"No build-method specified" >&2 - exit 1 - ;; - (*) echo $"Unknown build-method '$method'" >&2 - exit 1 - ;; + (x) panic $"No build-method specified";; + (*) panic $"Unknown build-method '$method'";; esac