#! /bin/bash
# $Header: /global/src/etc/cl-manage-scripts/patches/RCS/P-eclipse-user,v 1.1 2006/10/17 23:12:01 pb22 Exp $
#
# Command to change the user of /usr/share/eclipse/{plugins,features}
#
# patch-file operation = shell

base=/usr/share/eclipse
samp=/etc/user-config/bundles

set -- `ls -l $samp`
user="$3" group="$4"

for d in plugins features
do
	if	test -d $base/$d/.
	then	set -- `ls -ld $base/$d/.`
		u="$3" g="$4"
		case "$u.$g" in
		"$user.$group")	: OK;;
		*)		echo $base/$d is $u.$g rather than $user.$group
				chown $user.$group $base/$d
				ls -ld $base/$d/.
		esac
	fi
done
