[Cdd-commits] r498 - in cdd/trunk/cdd: debian devtools share/cdd/unixgroups share/menu templates
CDD Subversion Commit
noreply at alioth.debian.org
Sat Dec 8 21:09:00 UTC 2007
Author: tille
Date: Sat Dec 8 21:09:00 2007
New Revision: 498
Modified:
cdd/trunk/cdd/debian/changelog
cdd/trunk/cdd/devtools/cdd-install-helper
cdd/trunk/cdd/share/cdd/unixgroups/cdd-actions
cdd/trunk/cdd/share/menu/cdd-menu
cdd/trunk/cdd/templates/config.config
cdd/trunk/cdd/templates/config.postinst
cdd/trunk/cdd/templates/config.templates
Log:
Bugfixes and respect menu-2 format in cdd-menu
Modified: cdd/trunk/cdd/debian/changelog
==============================================================================
--- cdd/trunk/cdd/debian/changelog (original)
+++ cdd/trunk/cdd/debian/changelog Sat Dec 8 21:09:00 2007
@@ -1,3 +1,15 @@
+cdd (0.4.5) unstable; urgency=low
+
+ * Add debconf templates for better menu handling
+ * Regard CDD-config.postinst.stub if user provides such a file
+ * share/cdd/unixgroups/cdd-actions: verify whether a group
+ that should be added just exists
+ * share/menu/cdd-menu: Prepend "!C menu-1" before each menu entry
+ that does not contain a "!C" line to enable menu entries in
+ menu-2 format
+
+ -- Andreas Tille <tille at debian.org> Sat, 20 Oct 2007 12:22:55 +0200
+
cdd (0.4.4) unstable; urgency=low
* Remove old useless comment in share/menu/cdd-menu
Modified: cdd/trunk/cdd/devtools/cdd-install-helper
==============================================================================
--- cdd/trunk/cdd/devtools/cdd-install-helper (original)
+++ cdd/trunk/cdd/devtools/cdd-install-helper Sat Dec 8 21:09:00 2007
@@ -99,6 +99,8 @@
CDDNAME=Debian-`echo ${cdd} | perl -ne 'print "\u\L$_";'`
fi
# Move templates for user configuration script
+ # In case there is a config postinst template, preserve this
+ [ -s debian/"$cdd"-config.postinst.stub ] && cp debian/"$cdd"-config.postinst.stub debian/"$cdd"-config.postinst
for comm in `ls /usr/share/cdd/templates/{config.*,apt.conf}` ; do
commname=`basename $comm`
SubstCDDName ${commname} ${cdd}-${commname}
Modified: cdd/trunk/cdd/share/cdd/unixgroups/cdd-actions
==============================================================================
--- cdd/trunk/cdd/share/cdd/unixgroups/cdd-actions (original)
+++ cdd/trunk/cdd/share/cdd/unixgroups/cdd-actions Sat Dec 8 21:09:00 2007
@@ -203,7 +203,11 @@
if [ "$#" -ne 2 ]; then
RET=64 # EX_USAGE
else
- ${DRYRUN} addgroup --system "${ROLE}" || true
+ # Check whether group yet exists
+ TESTGROUP="`getent group ${ROLE}`" || true
+ if [ -z "${TESTGROUP}" ] ; then
+ ${DRYRUN} addgroup --system "${ROLE}" || true
+ fi
RET=$?
fi
return ${RET}
Modified: cdd/trunk/cdd/share/menu/cdd-menu
==============================================================================
--- cdd/trunk/cdd/share/menu/cdd-menu (original)
+++ cdd/trunk/cdd/share/menu/cdd-menu Sat Dec 8 21:09:00 2007
@@ -138,7 +138,9 @@
if [ ! -z "$hint" ] ; then
hint="hints=\""$hint"\""
fi
+ # Force menu-1 entry in case before this was menu-2 used
cat <<EOT
+!C menu-1
?package($pkg): needs="text" \\
section="$SECTION" \\
title="`NameToUpper "$pkg"`" $hint \\
@@ -163,6 +165,11 @@
pkgmenufile=/usr/lib/menu/"$pkg"
fi
if [ ! -z "$pkgmenufile" ] ; then
+ # Force menu-1 entry in case before this was menu-2 used if
+ # no menu format is mentioned explicitely
+ if ! grep -q -c '^!C' $pkgmenufile ; then
+ echo '!C menu-1'
+ fi
if [ $donotchange -eq 1 ] ; then
# the 2. and 3. -e - expression tries to fix missing '"' around the entries
sed -e "/^[[:space:]]*$/d" \
Modified: cdd/trunk/cdd/templates/config.config
==============================================================================
--- cdd/trunk/cdd/templates/config.config (original)
+++ cdd/trunk/cdd/templates/config.config Sat Dec 8 21:09:00 2007
@@ -7,8 +7,13 @@
db_capb backup
fi
-db_input "medium" "shared/#CDD#-config/usermenus" || true
+db_input "medium" "shared/#CDD#-config/useusermenus" || true
db_go
+db_get shared/#CDD#-config/useusermenus
+if [ $RET ] ; then
+ db_input "medium" "shared/#CDD#-config/usermenus" || true
+ db_go
+fi
# if cdd-config package is not yet installed we have to stop here
if [ ! -f /etc/cdd/cdd.conf ] ; then
Modified: cdd/trunk/cdd/templates/config.postinst
==============================================================================
--- cdd/trunk/cdd/templates/config.postinst (original)
+++ cdd/trunk/cdd/templates/config.postinst Sat Dec 8 21:09:00 2007
@@ -17,20 +17,30 @@
. /usr/share/debconf/confmodule
db_version 2.0
-db_get #CDD#-config/group
+# If $USEUSERMENU is not set in /etc/cdd/#CDD#/#CDD#.conf read it from debconf database
+if [ -z $USEUSERMENU ] ; then
+ db_get shared/#CDD#-config/useusermenus
+ if [ $RET ] ; then
+ USEUSERMENU="yes"
+ fi
+fi
-CURRENTCDDUSERS=`getUsersInRole #CDD# #CDD# 1`
-# Add those users which were selected but are not yet in the group
-for user in `echo "$RET" | sed "s/([^)]*)//g" | sed "s/ //g" | tr ',' '\n'` ; do
- if [ `echo "${CURRENTCDDUSERS}" | grep -c -w "$user"` -eq 0 ] ; then
- /usr/sbin/cdd-user add #CDD# $user
- fi
-done
-# Del those users which were obviousely removed from list of CDD users
-for user in `getAllUsers 1` ; do
- if [ `echo "$RET" | grep -c -w "$user"` -eq 0 ] && [ `getent group #CDD# | grep -c -w $user` -gt 0 ] ; then
- /usr/sbin/cdd-user del #CDD# $user
- fi
-done
+if [ "$USEUSERMENU" = "yes" ] ; then
+ db_get #CDD#-config/group
+
+ CURRENTCDDUSERS=`getUsersInRole #CDD# #CDD# 1`
+ # Add those users which were selected but are not yet in the group
+ for user in `echo "$RET" | sed "s/([^)]*)//g" | sed "s/ //g" | tr ',' '\n'` ; do
+ if [ `echo "${CURRENTCDDUSERS}" | grep -c -w "$user"` -eq 0 ] ; then
+ /usr/sbin/cdd-user add #CDD# $user
+ fi
+ done
+ # Del those users which were obviousely removed from list of CDD users
+ for user in `getAllUsers 1` ; do
+ if [ `echo "$RET" | grep -c -w "$user"` -eq 0 ] && [ `getent group #CDD# | grep -c -w $user` -gt 0 ] ; then
+ /usr/sbin/cdd-user del #CDD# $user
+ fi
+ done
+fi
#DEBHELPER#
Modified: cdd/trunk/cdd/templates/config.templates
==============================================================================
--- cdd/trunk/cdd/templates/config.templates (original)
+++ cdd/trunk/cdd/templates/config.templates Sat Dec 8 21:09:00 2007
@@ -11,8 +11,9 @@
Default: never
_Description: Build user menus at:
The meta packages of the #CDDNAME# Custom Debian Distribution
- contain extra role based menus for users. These will be built when
- a user who is registered to a given role uses the "update-menus"
+ contain extra menus that will be auto generated from existing packages.
+ If the role based user menu option was choosen these menus will be built
+ when a user who is registered to a given role uses the "update-menus"
utility. This can be done automatically for all users who are registered
for #CDDNAME# after installation of each single meta package,
at the end of the whole installation process to save time in case
@@ -23,3 +24,12 @@
* End of installation : Call "update-menus" only once at the end of
the whole installation/upgrading process;
* Never : Do not call "update-menus" at all.
+
+Template: shared/#CDD#-config/useusermenus
+Type: boolean
+_Description: Do you want user menus?
+ The menus for the #CDDNAME# Custom Debian Distribution could be
+ implemented as user menus which means they are visible only for those
+ users that will be selected explicitely. If you want this answer the
+ now with "yes". Be warned that selecting the users from a large list
+ does not scale very well.
More information about the Cdd-commits
mailing list