4 # Copyright (C) 2011 Daniel Hokka Zakrisson <daniel@hozac.com>
5 # Copyright (C) 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; version 2 of the License.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 : ${UTIL_VSERVER_VARS:=/usr/lib/util-vserver/util-vserver-vars}
21 test -e "$UTIL_VSERVER_VARS" || {
22 echo $"Can not find util-vserver installation (the file '$UTIL_VSERVER_VARS' would be expected); aborting..." >&2
25 . "$UTIL_VSERVER_VARS"
32 $"Usage: $0 <command> <vserver-name>* [--all] -- <params>+
34 <command> is any of urpmi/urpme/urpmi.update/urpmf/etc
36 Report bugs to <$PACKAGE_BUGREPORT>."
40 function showVersion()
43 $"vurpm $PACKAGE_VERSION -- urpmi/urpme for vservers
44 This program is part of $PACKAGE_STRING
46 Copyright (C) 2005 Enrico Scholz
47 This program is free software; you may redistribute it under the terms of
48 the GNU General Public License. This program has absolutely no warranty."
52 tmp=$(getopt -o +q --long help,version,debug,quiet,all -n "$0" -- "$@") || exit 1
55 declare -a send_through urpmi_opts
59 (--help) showHelp $0 ;;
60 (--version) showVersion ;;
61 (--debug) send_through=( "${send_through[@]}" "$1" ); set -x;;
62 (--quiet|-q) send_through=( "${send_through[@]}" "$1" );;
63 (--all) urpmi_opts=( "${yum_opts[@]}" "$1" );;
65 (*) echo $"vurpm: internal error; arg=='$1'" >&2; exit 1;;
70 VSOMETHING_TITLE=vurpm
71 VSOMETHING_WORKER=$_VURPM_WORKER
74 export VSOMETHING_TITLE VSOMETHING_WORKER VSOMETHING_PKGMGMT
77 export VURPM_CMD="$cmd"
80 test ${#urpmi_opts[@]} -eq 0 || urpmi_opts=( "${urpmi_opts[@]}" -- )
81 exec $_VSOMETHING "${send_through[@]}" "$cmd" "${urpmi_opts[@]}" "$@"