made it 'bash'
authorEnrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
Thu, 30 Oct 2003 00:31:52 +0000 (00:31 +0000)
committerEnrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
Thu, 30 Oct 2003 00:31:52 +0000 (00:31 +0000)
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

index 6bbddfb..a493ab3 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 
 # Copyright (C) 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
 # based on distrib-info by Jacques Gelinas
 # 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 $*