#!/bin/bash
# vim: ts=4 sw=4 ai noet
# $Id$
#
# Copyright (C) 2008, Robert Nelson. Licensed under GPLv2.
# By Robert Nelson.
#
# Portions originally:
# Copyright (C) 2003, 2004, 2005, 2006 by SWsoft. Licensed under GNU GPL.
#

test -n "$DEBUG_EXEC" && set -o xtrace

TOOLDIR=/usr/share/vzpkg2

. ${TOOLDIR}/yum-functions

log4 Started $0 $*

CMD=$1
shift

PACKAGES=$*

case $CMD in
--installed)	ARGS='-qa --queryformat=%{name}-%{version}-%{release}\n';;
--info)			ARGS='-q --info';;
--files)		ARGS='-ql';;
--search)		ARGS='-q --whatprovides';;
*)				abort "Invalid command";;
esac

$VZCTL exec2 $VEID yum $ARGS $PACKAGES

exit $?
