X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=util-vserver%2Fscripts%2Fvrpm;h=b5ff1074ffcb47280d1f2317092d0ea01593d44a;hb=732a86ac5e988c1be41076b609266130bdb3e8bb;hp=8c5e8d5278bd1e4072aa93c3fad0192d34108ded;hpb=da691fd4bad5e187b307b7fd86bf5fd61e47c3fc;p=util-vserver.git diff --git a/util-vserver/scripts/vrpm b/util-vserver/scripts/vrpm index 8c5e8d5..b5ff107 100755 --- a/util-vserver/scripts/vrpm +++ b/util-vserver/scripts/vrpm @@ -1,12 +1,11 @@ -#!/bin/sh +#! /bin/bash +# $Id$ # Copyright (C) 2003 Enrico Scholz -# based on vrpm by Jacques Gelinas # # 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 -# the Free Software Foundation; either version 2, or (at your option) -# any later version. +# the Free Software Foundation; version 2 of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -17,89 +16,64 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# Wrapper to update/install package in many vservers at once - : ${UTIL_VSERVER_VARS:=$(dirname $0)/util-vserver-vars} test -e "$UTIL_VSERVER_VARS" || { echo "Can not find util-vserver installation; aborting..." exit 1 } . "$UTIL_VSERVER_VARS" +. "$_LIB_FUNCTIONS" + +function showHelp() +{ + echo "Usage: $0 * [--all] [--help] [--version] [--unify] -- +" + exit $1 +} -usage(){ - echo vrpm: Install/Updates packages in several vservers at once - echo vrpm vservers ... -- rpm options and packages - echo vrpm \[--unify\] ALL -- rpm options and packages - echo vrpm \[--unify\] server1 server2 -- -Uvh package.rpm - echo - echo vrpm is executed in the root server - echo "--unify run vunify on the vserver for the updated packages" +function showVersion() +{ + cat <&2 + +cnt=0 +res=255 +for i in "${vservers[@]}"; do + cnt=$[ cnt + 1 ] + "$_NEW_NAMESPACE" "$_VRPM_WORKER" "$i" "$@" + res=$? +done + +test -z "$do_unify" || echo "unify currently unsupported" >&2 +test "$cnt" -ge 0 || echo "No vservers specified" >&2 +exit $res