#! /bin/sh
# $Header: /global/src/usr.bin/RCS/apt-get,v 1.1 2010/11/12 08:13:30 pb22 Exp $

# run apt-get under cl-asuser and try to record what was done.
# Hoped to work for simple cases
bundles=/etc/user-config/bundles

if	cl-asuser apt-get "$@"
then	op="$1"; shift
	case "$op" in
	install)	echo "# add $@ to $bundles"
			echo "$@" | tr ' ' '\12' >> $bundles;;
	remove|pruge)	echo "# remove $@ from $bundles"
			echo "$@" | tr ' ' '\12'  | sed 's/^/NOT_/'>> $bundles;;
	*)		echo "## Op '$op' not recognised - ignored";;
	esac
fi
