[Cdd-commits] r269 - in cdd/branches/cdd/0.3.x: . debian examples/common share/cdd share/cdd/menu share/cdd/unixgroups templates

Otavio Salvador debian-custom@lists.debian.org
Tue, 20 Jul 2004 14:23:59 -0600


Author: otavio
Date: Tue Jul 20 14:23:58 2004
New Revision: 269

Modified:
   cdd/branches/cdd/0.3.x/cdd-install-helper.1
   cdd/branches/cdd/0.3.x/cdd-update-menus
   cdd/branches/cdd/0.3.x/debian/cdd-common.docs
   cdd/branches/cdd/0.3.x/debian/cdd-common.install
   cdd/branches/cdd/0.3.x/debian/changelog
   cdd/branches/cdd/0.3.x/examples/common/control
   cdd/branches/cdd/0.3.x/share/cdd/cdd-update-menus
   cdd/branches/cdd/0.3.x/share/cdd/menu/cdd-menu
   cdd/branches/cdd/0.3.x/share/cdd/unixgroups/cdd-actions
   cdd/branches/cdd/0.3.x/templates/postinst
Log:
Merge changes did in 0.3.1.

Modified: cdd/branches/cdd/0.3.x/cdd-install-helper.1
==============================================================================
--- cdd/branches/cdd/0.3.x/cdd-install-helper.1	(original)
+++ cdd/branches/cdd/0.3.x/cdd-install-helper.1	Tue Jul 20 14:23:58 2004
@@ -8,8 +8,9 @@
 
 .SH DESCRIPTION
 This script can be used in debian/rules file to install the user menu
-files to /etc/<cdd>/menu/<package>,  a link for the helper script of every
-<cdd>-* package and the link to the manpage for this script.
+files to /etc/cdd/\fI<cdd>\fR/menu/\fI<package>\fR,  a link for the
+helper script of every \fI<cdd>\fR-* package and the link to the manpage
+for this script.
 .TP
 .I menu
 If a directory
@@ -18,7 +19,7 @@
 (without the "cdd-" name prefix).  These files should be valid menu files
 as they are provided for Debian packages in debian/menu.  They will be
 copied to
-.I debian/<pkg>/etc/<cdd>/menu/<pkg>
+.I debian/<pkg>/etc/cdd/<cdd>/menu/<pkg>
 where tools like
 .B cdd-user(8)
 will expect them.
@@ -51,6 +52,8 @@
 The files which reside in the optional directory
 .I docs/<pkg_without_cdd-prefix>/
 will be copied to the apropriate doc directory of the meta-package.
+.TP
+.I conf
 If there exists a file
 .I common/conf
 and has a size greater than 0 this is used as special configuration file

Modified: cdd/branches/cdd/0.3.x/cdd-update-menus
==============================================================================
--- cdd/branches/cdd/0.3.x/cdd-update-menus	(original)
+++ cdd/branches/cdd/0.3.x/cdd-update-menus	Tue Jul 20 14:23:58 2004
@@ -1,6 +1,6 @@
 #!/bin/bash
 #
-# $Id: cdd-update-menus,v 1.9 2004/04/20 10:46:41 kalfa Exp $
+# $Id: cdd-update-menus,v 1.10 2004/05/07 16:01:33 kalfa Exp $
 
 usage() {
    echo "Usage: `basename $0` [ -u <user> | -d <CDD> ]"
@@ -38,7 +38,7 @@
 				usage
 				exit 64
 			elif [ -n "${CDDUSER}" ]; then
-				cddLog "You cannot specify --cdd and --user at the some time" 
+				cddLog "You cannot specify --cdd and --user at the same time" 
 				cddLog ""
 				usage
 				exit 0
@@ -79,12 +79,15 @@
 if [ -n "${CDDUSER}" ]; then 
 	SYSSCRIPT="${SHAREDIR}/menu/cdd-menu"
 	USERSCRIPT="`getUserHome ${CDDUSER}`/.menu/cdd-menu"
+
+	set -e
 	checkUser ${CDDUSER} || \
 		cddFail 67 "User does not exist"
 	isUserRegistered ${CDDUSER} || \
-		cddFail 67 "User  ${CDDUSER} is not registered to any CDD"
+		cddFail 67 "User ${CDDUSER} is not registered to any CDD"
 	
-	updateUser ${CDDUSER} "${SYSSCRIPT}" "${USERSCRIPT}"
+	# there's nothing to do on per user basis criteria
+	#updateUser ${CDDUSER} "${SYSSCRIPT}" "${USERSCRIPT}"
 	set +e
 
 # update menu scripts for any user registered into the specified CDD
@@ -98,8 +101,9 @@
 	checkCDD ${CDD} || \
 		cddFail $? "Custom distribution ${CDD} does not exist"
 		
-	SYSSCRIPT="${SHAREDIR}/menu/cdd-menu"
-	updateCDD ${CDD} "${SYSSCRIPT}"
+	# there's nothing to do on per CDD basis criteria
+	#SYSSCRIPT="${SHAREDIR}/menu/cdd-menu"
+	#updateCDD ${CDD} "${SYSSCRIPT}"
 	set +e
 else
     exec $0 --user `whoami`

Modified: cdd/branches/cdd/0.3.x/debian/cdd-common.docs
==============================================================================
--- cdd/branches/cdd/0.3.x/debian/cdd-common.docs	(original)
+++ cdd/branches/cdd/0.3.x/debian/cdd-common.docs	Tue Jul 20 14:23:58 2004
@@ -1,2 +1,3 @@
 BUGS
 README.CDD
+debian/NEWS.Debian

Modified: cdd/branches/cdd/0.3.x/debian/cdd-common.install
==============================================================================
--- cdd/branches/cdd/0.3.x/debian/cdd-common.install	(original)
+++ cdd/branches/cdd/0.3.x/debian/cdd-common.install	Tue Jul 20 14:23:58 2004
@@ -2,5 +2,6 @@
 cdd-role            usr/sbin
 cdd-update-menus    usr/sbin
 get-group-users     usr/sbin
+share/cdd/menu/cdd-menu usr/lib/menu
 share               usr
 etc/*               etc

Modified: cdd/branches/cdd/0.3.x/debian/changelog
==============================================================================
--- cdd/branches/cdd/0.3.x/debian/changelog	(original)
+++ cdd/branches/cdd/0.3.x/debian/changelog	Tue Jul 20 14:23:58 2004
@@ -1,3 +1,13 @@
+cdd (0.3.1) unstable; urgency=low
+
+  * Do not change ${HOME}/.menu any more as it was done in 0.3
+    Thanks to Cosimo Alfarano <kalfa@debian.org>
+  * Provide man page for cdd.conf
+  * Added newline at end of examples/common/control
+    Closes: #251889
+
+ -- Andreas Tille <tille@debian.org>  Mon, 31 May 2004 22:45:56 +0200
+
 cdd (0.3) unstable; urgency=low
 
   * Cosimo Alfarano <kalfa@debian.org> did some major rewriting

Modified: cdd/branches/cdd/0.3.x/examples/common/control
==============================================================================
--- cdd/branches/cdd/0.3.x/examples/common/control	(original)
+++ cdd/branches/cdd/0.3.x/examples/common/control	Tue Jul 20 14:23:58 2004
@@ -4,3 +4,4 @@
 Description: Debian-_CDD_ Project common package
  This package builds the basic infra structure of all meta packages
  for the Debian-_CDD_ Custom Debian Distribution.
+

Modified: cdd/branches/cdd/0.3.x/share/cdd/cdd-update-menus
==============================================================================
--- cdd/branches/cdd/0.3.x/share/cdd/cdd-update-menus	(original)
+++ cdd/branches/cdd/0.3.x/share/cdd/cdd-update-menus	Tue Jul 20 14:23:58 2004
@@ -1,4 +1,4 @@
-# $Id: cdd-update-menus,v 1.5 2004/04/20 10:46:41 kalfa Exp $
+# $Id: cdd-update-menus,v 1.6 2004/05/07 16:01:33 kalfa Exp $
 
 # check if I am a specific user
 amI() {
@@ -11,76 +11,79 @@
 updateUser() {
 	RET=0
 	SYSUSER=$1
-	SYSSCRIPT=$2
-	USERSCRIPT=$3
-
-	UHOME=`getUserHome ${SYSUSER}`
-	if [ $# -ne 3 ]; then
-		RET=64 # EX_USAGE
-	elif [ ! -x "${SYSSCRIPT}" ]; then
-		cddFail 66 "Fatal: ${SYSSCRIPT} doesn't exist"
-
-	# and now real check for user's USERSCRIPT symlink presence
-	else
-		if [ ! -d "`dirname ${USERSCRIPT}`" ]; then
-			# directory ~/.menu doesn't exist, create it and link the sys
-			# script
-			# returning <that's all right>
-			echo "Creating `dirname ${USERSCRIPT}` and cdd-menu link inside"
-			${DRYRUN} mkdir "`dirname ${USERSCRIPT}`"
-			${DRYRUN} ln -fs "${SYSSCRIPT}" "${USERSCRIPT}"
-			${DRYRUN} chown -R ${CDDUSER}: "`dirname ${USERSCRIPT}`"
-
-		elif [ -f "${USERSCRIPT}" -a ! -L "${USERSCRIPT}" ]; then
-			# parent directory of ${USERSCRIPT} exists and has cdd-menu, but
-			# it's not a link probably it's a script modified by user write a
-			# warning and RET=0
-
-			# TODO PERFORM ANY ACTIONS? 
-			cddLog "Warning: ${USERSCRIPT} isn't a symlink, probably ${CDDUSER} modified it."
-			cddLog "Warning: Check it. please."
-
-		else
-			# here we're sure that if the file exists, it's a symlink 
-			# returning <that's all right>
-
-			cddLog "Updating cdd-menu script for user ${CDDUSER}"
-			${DRYRUN} rm -f "${USERSCRIPT}"
-			${DRYRUN} ln -fs "${SYSSCRIPT}" "${USERSCRIPT}"
-			${DRYRUN} chown ${CDDUSER}: "${USERSCRIPT}"
-		fi
-	fi
+#	SYSSCRIPT=$2
+#	USERSCRIPT=$3
+#
+#	UHOME=`getUserHome ${SYSUSER}`
+#	if [ $# -ne 3 ]; then
+#		RET=64 # EX_USAGE
+#	elif [ ! -x "${SYSSCRIPT}" ]; then
+#		cddFail 66 "Fatal: ${SYSSCRIPT} doesn't exist"
+#
+#	# and now real check for user's USERSCRIPT symlink presence
+#	else
+#		if [ ! -d "`dirname ${USERSCRIPT}`" ]; then
+#			# directory ~/.menu doesn't exist, create it and link the sys
+#			# script
+#			# returning <that's all right>
+#			echo "Creating `dirname ${USERSCRIPT}` and cdd-menu link inside"
+#			${DRYRUN} mkdir "`dirname ${USERSCRIPT}`"
+#			${DRYRUN} ln -fs "${SYSSCRIPT}" "${USERSCRIPT}"
+#			${DRYRUN} chown -R ${CDDUSER}: "`dirname ${USERSCRIPT}`"
+#
+#		elif [ -f "${USERSCRIPT}" -a ! -L "${USERSCRIPT}" ]; then
+#			# parent directory of ${USERSCRIPT} exists and has cdd-menu, but
+#			# it's not a link probably it's a script modified by user write a
+#			# warning and RET=0
+#
+#			# TODO PERFORM ANY ACTIONS? 
+#			cddLog "Warning: ${USERSCRIPT} isn't a symlink, probably ${CDDUSER} modified it."
+#			cddLog "Warning: Check it. please."
+#
+#		else
+#			# here we're sure that if the file exists, it's a symlink 
+#			# returning <that's all right>
+#
+#			cddLog "Updating cdd-menu script for user ${CDDUSER}"
+#			${DRYRUN} rm -f "${USERSCRIPT}"
+#			${DRYRUN} ln -fs "${SYSSCRIPT}" "${USERSCRIPT}"
+#			${DRYRUN} chown ${CDDUSER}: "${USERSCRIPT}"
+#		fi
+#	fi
 	return ${RET}
 }
 
 # updates menu scripts for any user registered in CDD
 updateCDD() {
+	RET=0
 	CDD=$1
-	SYSSCRIPT=$2
-
-	ROLES="`getCDDRoleList ${CDD}`"
-	if [ $# -ne 2 ]; then
-		RET=64 # EX_USAGE
-	else
-		cddLog "Updating menu script for all users in ${CDD} CDD:"
-		for ROLE in ${ROLES}; do
-			for CDDUSER in `getUsersInRole ${CDD} ${ROLE}`; do
-				UHOME="`getUserHome ${CDDUSER}`"
-				if [ ! -d "${UHOME}" ] ; then
-				   logFail 67  "Home directory for user ${CDDUSER} does not exist.\n... Sorry can not update menus."
-				fi
-
-				USERSCRIPT="${UHOME}/.menu/cdd-menu"
-				updateUser "${CDDUSER}" "${SYSSCRIPT}" "${USERSCRIPT}"
-			done
-		done
-
-		# The above commented code isn't bad, only complex for the actual
-		# state of the CDD menu system:
-		# Update user menu script for a specific CDD can be delegated entirely
-		# to ${SYSSCRIPT} script. 
-		# The only needing is a correct cdd-menu script to be executed by
-		# update-menus, let's easy up script!
-
-	fi
+#	SYSSCRIPT=$2
+#
+#	ROLES="`getCDDRoleList ${CDD}`"
+#	if [ $# -ne 2 ]; then
+#		RET=64 # EX_USAGE
+#	else
+#		cddLog "Updating menu script for all users in ${CDD} CDD:"
+#		for ROLE in ${ROLES}; do
+#			for CDDUSER in `getUsersInRole ${CDD} ${ROLE}`; do
+#				UHOME="`getUserHome ${CDDUSER}`"
+#				if [ ! -d "${UHOME}" ] ; then
+#				   logFail 67  "Home directory for user ${CDDUSER} does not exist.\n... Sorry can not update menus."
+#				fi
+#
+#				USERSCRIPT="${UHOME}/.menu/cdd-menu"
+#				updateUser "${CDDUSER}" "${SYSSCRIPT}" "${USERSCRIPT}"
+#			done
+#		done
+#
+#		# The above commented code isn't bad, only complex for the actual
+#		# state of the CDD menu system:
+#		# Update user menu script for a specific CDD can be delegated entirely
+#		# to ${SYSSCRIPT} script. 
+#		# The only needing is a correct cdd-menu script to be executed by
+#		# update-menus, let's easy up script!
+#
+#	fi
+	
+	return ${RET}
 }

Modified: cdd/branches/cdd/0.3.x/share/cdd/menu/cdd-menu
==============================================================================
--- cdd/branches/cdd/0.3.x/share/cdd/menu/cdd-menu	(original)
+++ cdd/branches/cdd/0.3.x/share/cdd/menu/cdd-menu	Tue Jul 20 14:23:58 2004
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 
 # Script to handle menu profiles for CDD subsystem, installed by your system
 # administrator via cdd-common package.
@@ -16,6 +16,9 @@
 
 CDDUSER=`whoami`
 
+# it has to be run only by unprivileged users via update-menus
+test "${CDDUSER}" == "root" && exit 0
+
 ALLCDD=`getCDDList`
 for CDD in ${ALLCDD}; do
 	# read generic and per CDD conf
@@ -23,10 +26,11 @@
 	test -f  ${CONFBASE}/${CDD}/${CDD}.conf && \
 		source ${CONFBASE}/${CDD}/${CDD}.conf
 	
-	# print on STDOUT menu generic entries 
-	test -d ${CONFBASE}/${CDD}/menu/ && \
-		find ${CONFBASE}/${CDD}/menu/ -maxdepth 1 -mindepth 1 -type f \
-			-exec cat {} \;
+	# print on STDOUT menu generic entries if user belongs to CDD
+	checkUserInCDD ${CDD} ${CDDUSER} && \ 
+		test -d ${CONFBASE}/${CDD}/menu/ && \
+			find ${CONFBASE}/${CDD}/menu/ -maxdepth 1 -mindepth 1 -type f \
+				-exec cat {} \;
 
 	# and role specific menu entries
 	for ROLE in `getUserRoles ${CDD} ${CDDUSER}`; do

Modified: cdd/branches/cdd/0.3.x/share/cdd/unixgroups/cdd-actions
==============================================================================
--- cdd/branches/cdd/0.3.x/share/cdd/unixgroups/cdd-actions	(original)
+++ cdd/branches/cdd/0.3.x/share/cdd/unixgroups/cdd-actions	Tue Jul 20 14:23:58 2004
@@ -1,4 +1,4 @@
-# $Id: cdd-actions,v 1.9 2004/04/19 19:20:22 kalfa Exp $
+# $Id: cdd-actions,v 1.10 2004/05/07 16:01:33 kalfa Exp $
 #
 # Backend dependant functions for cdd package
 #
@@ -50,7 +50,7 @@
 	return ${RET}
 }
 
-
+# checks if user $2 is registered in CDD $1
 checkUserInCDD() {
 	RET=0
 	CDD=$1
@@ -63,7 +63,6 @@
 		RET=1 # user has no role, so is not registered in CDD
 	fi
 	return ${RET}
-
 }
 
 # GET Functions

Modified: cdd/branches/cdd/0.3.x/templates/postinst
==============================================================================
--- cdd/branches/cdd/0.3.x/templates/postinst	(original)
+++ cdd/branches/cdd/0.3.x/templates/postinst	Tue Jul 20 14:23:58 2004
@@ -5,13 +5,21 @@
 
 source /etc/cdd/cdd.conf
 if [ -s /etc/cdd/#CDD#/#CDD#.conf ] ; then source /etc/cdd/#CDD#/#CDD#.conf ; fi
-if [ "${UPDATEUSERMENU}" = "yes" ] ; then
-        for ROLE in `getCDDRoleList #CDD#`; do
-                for CDDUSER in `getUsersInRole #CDD# ${ROLE}`; do
-		        echo "Adding menu for user ${CDDUSER} of #CDD# ..."
-                        su ${CDDUSER} -c "update-menus"
-                done
+for ROLE in `getCDDRoleList #CDD#`; do
+        for CDDUSER in `getUsersInRole #CDD# ${ROLE}`; do
+		if [ "${UPDATEUSERMENU}" = "yes" ] ; then
+			# Update user menus if UPDATEUSERMENU is set to yes
+            		echo "Adding menu for user ${CDDUSER} of #CDD# ..."
+            		su ${CDDUSER} -c "update-menus"
+		fi
+
+		# Version 0.3 changed ${HOME}/.menu which is not necessary any more and
+		# thus files will be removed now
+		USERHOME="`getUserHome ${CDDUSER}`"
+		OLDENTRY="${USERHOME}/.menu/cdd-menu"
+		test -L ${OLDENTRY} && rm -f ${OLDENTRY} \
+			    && cddLog "Removing old menu entry for ${CDDUSER}"
         done
-fi
+done
 
 #DEBHELPER#