X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=scripts%2Flegacy%2Fdistrib-info;fp=scripts%2Flegacy%2Fdistrib-info;h=0000000000000000000000000000000000000000;hb=db5ef3f969fc6ad34aeb5903e44d0049b2e50791;hp=cc5b93652123cd8f8fe7d4bb90170fd10314dea9;hpb=95e2774070e989fe9cf9f48dae5fa054e55e2a3e;p=util-vserver.git diff --git a/scripts/legacy/distrib-info b/scripts/legacy/distrib-info deleted file mode 100755 index cc5b936..0000000 --- a/scripts/legacy/distrib-info +++ /dev/null @@ -1,76 +0,0 @@ -#!/bin/bash - -# Copyright (C) 2003 Enrico Scholz -# based on distrib-info 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. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - - -# This scripts knows about every possible distribution (well, it should) -# It is passed a vserver name and a key (a command). The key represent a task. -# It executes the command and output on stdout. -# For example -# distrib-info vserver1 pkgversion -# If vserver1 is a redhat system, it executes -# rpm -qa --queryformat "%{name}=%{version}-%{release} -: ${UTIL_VSERVER_VARS:=/usr/lib/util-vserver/util-vserver-vars} -test -e "$UTIL_VSERVER_VARS" || { - echo $"Can not find util-vserver installation (the file '$UTIL_VSERVER_VARS' would be expected); aborting..." >&2 - exit 1 -} -. "$UTIL_VSERVER_VARS" - -if [ "$1" = "" ] ; then - echo distrib-info vserver-name command [ args ... ] >&2 - echo Commands are: >&2 - echo dumpfiles: Shows all files owned by a package >&2 - echo pkgversion: reports all packages and their version/release >&2 - echo unifiles: reports all unify-able file of a package >&2 - exit 1 -fi -if [ "$1" = "/" ] ; then - DISTDIR=/ - CHROOTCMD= -elif [ -d "$1" ] ; then - DISTDIR=$1 - CHROOTCMD="$__SBINDIR/chroot $DISTDIR" -else - DISTDIR=$__DEFAULT_VSERVERDIR/$1 - CHROOTCMD="$__SBINDIR/chroot $DISTDIR" -fi -KEY=$2 -shift -shift -if [ -f $DIRDIR/etc/redhat-release -o -f $DISTDIR/etc/mandrake-release ] ; then - case $KEY in - pkgversion) - $CHROOTCMD /bin/rpm -qa --queryformat "%{name}=%{version}-%{release}\n" - ;; - unifiles) - # We remove /etc and /var/log to make sure no special file - # there will be unified - $CHROOTCMD /bin/rpm -ql --dump $* \ - | $_PARSERPMDUMP /etc/ - ;; - dumpfiles) - $CHROOTCMD /bin/rpm -ql $* - ;; - *) - echo unknown request $KEY >&2 - ;; - esac -else - echo Distribution not supported yet >&2 -fi