[Cdd-commits] r283 - in cdd/tags/cdd/0.3.9: . share/menu templates
Andreas Tille
debian-custom@lists.debian.org
Thu, 12 Aug 2004 13:40:12 -0600
Author: tille
Date: Thu Aug 12 13:40:11 2004
New Revision: 283
Modified:
cdd/tags/cdd/0.3.9/cdd-install-helper
cdd/tags/cdd/0.3.9/share/menu/cdd-menu
cdd/tags/cdd/0.3.9/templates/postrm
Log:
Latest changes before my holiday when svn server was broken.
Modified: cdd/tags/cdd/0.3.9/cdd-install-helper
==============================================================================
--- cdd/tags/cdd/0.3.9/cdd-install-helper (original)
+++ cdd/tags/cdd/0.3.9/cdd-install-helper Thu Aug 12 13:40:11 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/tags/cdd/0.3.9/share/menu/cdd-menu
==============================================================================
--- cdd/tags/cdd/0.3.9/share/menu/cdd-menu (original)
+++ cdd/tags/cdd/0.3.9/share/menu/cdd-menu Thu Aug 12 13:40:11 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/tags/cdd/0.3.9/templates/postrm
==============================================================================
--- cdd/tags/cdd/0.3.9/templates/postrm (original)
+++ cdd/tags/cdd/0.3.9/templates/postrm Thu Aug 12 13:40:11 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