[Cdd-commits] r284 - in cdd/trunk/cdd: . share/menu templates

Andreas Tille debian-custom@lists.debian.org
Thu, 12 Aug 2004 14:06:32 -0600


Author: tille
Date: Thu Aug 12 14:06:31 2004
New Revision: 284

Modified:
   cdd/trunk/cdd/cdd-install-helper
   cdd/trunk/cdd/share/menu/cdd-menu
   cdd/trunk/cdd/templates/postrm
Log:
Syncronize also the trunk directory with real upload state.


Modified: cdd/trunk/cdd/cdd-install-helper
==============================================================================
--- cdd/trunk/cdd/cdd-install-helper	(original)
+++ cdd/trunk/cdd/cdd-install-helper	Thu Aug 12 14:06:31 2004
@@ -27,24 +27,29 @@
     # if we provide an extra menu which overrides some menus provided by
     # the maintainers of the dependand packages move them now to the right
     # directory
-    if [ -d menu -a -e menu/"$pkg" ] ; then
+    [ -d menu ] && [ -d menu/"$pkg" ] && \
+	    if [ `find menu/"$pkg" -name \*.menu -maxdepth 1 | wc -l` -gt 0 ] ; then
 	mkdir -p debian/"$cdd"-"$pkg"/"$menudir"
-	cp -a menu/"$pkg" debian/"$cdd"-"$pkg"/"$menudir"/"$cdd"-"$pkg"
+	for dep in `find menu/"$pkg" -name \*.menu -maxdepth 1` ; do
+		cp -a "$dep" debian/"$cdd"-"$pkg"/"$menudir"/`basename "$dep" .menu`
+        done
     fi
 
     # Provide a README.Debian in any case
     mkdir -p debian/"$cdd"-"$pkg"/usr/share/doc/"$cdd"-"$pkg"
     [ ! -s docs/"$pkg"/README.Debian ] && cp -a /usr/share/cdd/templates/README.Debian debian/"$cdd"-"$pkg"/usr/share/doc/"$cdd"-"$pkg"
-    # Check for documentation of packages which should be viewed in
+    # Check for documentation of packages (*.txt or *.html) which should be viewed in
     # case of missing GUI
-    if [ -d menu/docs -a -d menu/docs/"$pkg" ] ; then
-	for dep in `ls menu/docs/"$pkg"/[a-z]*.txt` ; do
+    [ -d menu ] && [ -d menu/"$pkg" ] && \
+	    if [ `find menu/"$pkg" -name \*.txt -o -name \*.html -maxdepth 1 | wc -l` -gt 0 ] ; then
+	for dep in `find menu/"$pkg" -name \*.txt -o -name \*.html -maxdepth 1` ; do
             # Formerly here was checked, whether this package is really listed in the
 	    # dependencies, with more clever menu handling it is enough to verify
 	    # whether it is mentioned at all in the package relations and the menu
 	    # system cares about whether a sugested package is installed or not
 	    depmenu=`basename ${dep} .txt`
-	    if ! grep -A 5 "Package: $cdd-$pkg" debian/control | grep -q -w ${depmenu} ; then
+	    if [ "$depmenu" = `basename ${dep}` ] ; then depmenu=`basename ${dep} .html` ; fi
+	    if ! grep -A 5 "Package: $cdd-$pkg" debian/control | grep -q -w "$depmenu" ; then
 		## echo "Package ${depmenu} seems not to be in dependencies"
 		continue
 	    fi

Modified: cdd/trunk/cdd/share/menu/cdd-menu
==============================================================================
--- cdd/trunk/cdd/share/menu/cdd-menu	(original)
+++ cdd/trunk/cdd/share/menu/cdd-menu	Thu Aug 12 14:06:31 2004
@@ -51,7 +51,7 @@
                 RET=64 # EX_USAGE
                 return ${RET}
         fi
-	head -1 $1 | sed -e "s/[[:space:]]\+/ /g" -e "s/^[[:space:]]*\(.*\)[[:space:]]*$$/\1/"
+	head -1 $1 | sed -e "s/[[:space:]]\+/ /g" -e "s/^[[:space:]]*\(.*\)[[:space:]]*$/\1/"
 	return 0
 }
 
@@ -90,7 +90,7 @@
 
 	# find the list of Depends / Recommends / Suggests
 	DepPkgs=`dpkg --status "$PKG" | \
-		sed -e "/^Description/,$$d" -e "/^Conffiles/,$$d" | \
+		sed -e '/^Description/,$d' -e '/^Conffiles/,$d' | \
 		grep -v ^[A-CE-QT-Z] | \
 		grep -v ^S[eot] | \
 		sed -e "s/([^)]*)//" \
@@ -101,6 +101,10 @@
 
 	# check whether CDD-maintainer provided menu override different from
 	# package maintainers menu file
+	# FIXME: This is outdated!  The concept of menu files named like the
+        #        meta package is stopped in favour of single menu files named like
+        #        the dependant package.  The rationale is that you can get more
+        #        fine grained replacements.
 	cddmenufile=""
 	if   [ -s "$HOME"/.menu/"$PKG" ] ; then
 		cddmenufile="$HOME"/.menu/"$PKG"
@@ -146,20 +150,32 @@
 	command="$senspager $docfile"
 EOT
 	    fi
-	    
+
+	    # search for a menu file with the following priority
+	    # ${HOME}/.menu, /etc/menu, /usr/share/cdd/${CDD}/menu, /usr/share/menu, /usr/lib/menu
 	    pkgmenufile=""
+	    donotchange=1
 	    if   [ -s "$HOME"/.menu/"$pkg" ] ; then
 		pkgmenufile="$HOME"/.menu/"$pkg"
-	    elif [ -s /etc/menu/$pkg ] ; then
-		pkgmenufile=/etc/menu/$pkg
-	    elif [ -s /usr/lib/menu/$pkg ] ; then
-		pkgmenufile=/usr/lib/menu/$pkg
-	    elif [ -s /usr/lib/share/$pkg ] ; then
-		pkgmenufile=/usr/share/menu/$pkg
+	    elif [ -s /etc/menu/"$pkg" ] ; then
+		pkgmenufile=/etc/menu/"$pkg"
+	    elif [ -s /usr/share/cdd/"$CDD"/menu/"$pkg" ] ; then
+		pkgmenufile=/usr/share/cdd/"$CDD"/menu/"$pkg"
+		donotchange=0
+	    elif [ -s /usr/share/menu/"$pkg" ] ; then
+		pkgmenufile=/usr/share/menu/"$pkg"
+	    elif [ -s /usr/lib/menu/"$pkg" ] ; then
+		pkgmenufile=/usr/lib/menu/"$pkg"
 	    fi
-	    if [ ! -z "$pkgmenufile" ] ; then
-		sed -e "/^[[:space:]]*$$/d" \
-		    -e "s?\(section\)[[:space:]]*=[[:space:]]*\"*[^\"\\]*\"*?\1=\""$SECTION"\"?" $pkgmenufile
+            if [ ! -z "$pkgmenufile" ] ; then
+		if [ $donotchange -eq 1 ] ; then
+		    sed -e "/^[[:space:]]*$/d" \
+			-e "s?\(section\)[[:space:]]*=[[:space:]]*\"*[^\"\\]*\"*?\1=\"$SECTION\"?" $pkgmenufile
+set +x
+		else
+		    # strip possible comments
+		    grep -v "^[[:space:]]*#" $pkgmenufile
+		fi
 	    fi
 	done
 	

Modified: cdd/trunk/cdd/templates/postrm
==============================================================================
--- cdd/trunk/cdd/templates/postrm	(original)
+++ cdd/trunk/cdd/templates/postrm	Thu Aug 12 14:06:31 2004
@@ -15,7 +15,7 @@
 
 if [ -x /usr/sbin/cdd-update-usermenus ] ; then
     # Initialize debconf if not yet done
-    if [ ! -z "$DEBCONF_REDIR" ]; then
+    if [ _"$DEBCONF_REDIR" = _"" ]; then
         . /usr/share/debconf/confmodule
         db_version 2.0
     fi