From 54d4c5c11cca1a25a1c41226a955542a70aabb09 Mon Sep 17 00:00:00 2001 From: Enrico Scholz Date: Thu, 30 Oct 2003 00:31:52 +0000 Subject: [PATCH] made it 'bash' use customizable paths for '/usr/sbin' git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/branches/SYSCALL_SWITCH@302 94cd875c-1c1d-0410-91d2-eb244daf1a30 --- util-vserver/scripts/distrib-info | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/util-vserver/scripts/distrib-info b/util-vserver/scripts/distrib-info index 6bbddfb..a493ab3 100755 --- a/util-vserver/scripts/distrib-info +++ b/util-vserver/scripts/distrib-info @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # Copyright (C) 2003 Enrico Scholz # based on distrib-info by Jacques Gelinas @@ -25,7 +25,12 @@ # distrib-info vserver1 pkgversion # If vserver1 is a redhat system, it executes # rpm -qa --queryformat "%{name}=%{version}-%{release} -USR_LIB_VSERVER=$(dirname $0) +: ${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" if [ "$1" = "" ] ; then echo distrib-info vserver-name command [ args ... ] >&2 @@ -40,10 +45,10 @@ if [ "$1" = "/" ] ; then CHROOTCMD= elif [ -d "$1" ] ; then DISTDIR=$1 - CHROOTCMD="/usr/sbin/chroot $DISTDIR" + CHROOTCMD="$SBINDIR/chroot $DISTDIR" else DISTDIR=/vservers/$1 - CHROOTCMD="/usr/sbin/chroot $DISTDIR" + CHROOTCMD="$SBINDIR/chroot $DISTDIR" fi KEY=$2 shift @@ -57,7 +62,7 @@ if [ -f $DIRDIR/etc/redhat-release -o -f $DISTDIR/etc/mandrake-release ] ; then # We remove /etc and /var/log to make sure no special file # there will be unified $CHROOTCMD /bin/rpm -ql --dump $* \ - | $USR_LIB_VSERVER/parserpmdump /etc/ + | $PKGLIBDIR/parserpmdump /etc/ ;; dumpfiles) $CHROOTCMD /bin/rpm -ql $* -- 1.8.1.5