From dd88d39fb6654ba30afa393f136f6d4090ffb34c Mon Sep 17 00:00:00 2001 From: Enrico Scholz Date: Tue, 30 Sep 2003 15:56:58 +0000 Subject: [PATCH] replaced with new version git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@7 94cd875c-1c1d-0410-91d2-eb244daf1a30 --- util-vserver/scripts/vrpm | 135 +++++++++++++++++++--------------------------- 1 file changed, 54 insertions(+), 81 deletions(-) diff --git a/util-vserver/scripts/vrpm b/util-vserver/scripts/vrpm index 8c5e8d5..6373b53 100755 --- a/util-vserver/scripts/vrpm +++ b/util-vserver/scripts/vrpm @@ -1,12 +1,10 @@ -#!/bin/sh +#! /bin/bash -e # 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 +15,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 \ No newline at end of file -- 1.8.1.5