X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=util-vserver%2Fscripts%2Fdistrib-info;h=a493ab385c72521b34b80839437407dee1e2969d;hb=c5774d5529e0481e9c7d324f6ac6a343180ca3fa;hp=6bbddfb2163bff4957fc5dfdbcfdb0ddd8334cf2;hpb=da691fd4bad5e187b307b7fd86bf5fd61e47c3fc;p=util-vserver.git 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 $*