[GRASS-CVS] william: grass6/macosx/app build_gui_user_menu.sh, 1.5,
1.6
grass at intevation.de
grass at intevation.de
Thu Nov 15 17:34:21 EST 2007
Author: william
Update of /grassrepository/grass6/macosx/app
In directory doto:/tmp/cvs-serv12178
Modified Files:
build_gui_user_menu.sh
Log Message:
a little catching up - generate new extension menu file format for GUI
Index: build_gui_user_menu.sh
===================================================================
RCS file: /grassrepository/grass6/macosx/app/build_gui_user_menu.sh,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- build_gui_user_menu.sh 11 Sep 2007 02:10:10 -0000 1.5
+++ build_gui_user_menu.sh 15 Nov 2007 22:34:19 -0000 1.6
@@ -2,7 +2,6 @@
# Build addon menu files, from the global /Library/GRASS/$GRASS_MMVER/Modules
# and the user's $HOME/Library/GRASS/$GRASS_MMVER/Modules.
-# It builds a etc/gm/addons folder full of tcl .menu menu files.
# test files to make sure they are appropriate for adding to the GUI menu.
# Using 'file', assume executable binaries OK. Check scripts to see if they
@@ -15,12 +14,18 @@
GRASS_MMVER=`cut -d . -f 1-2 "$GISBASE/etc/VERSIONNUMBER"`
BINDIR="$HOME/Library/GRASS/$GRASS_MMVER/Modules/bin"
BINDIRG="/Library/GRASS/$GRASS_MMVER/Modules/bin"
-MENUDIR="$HOME/Library/GRASS/$GRASS_MMVER/Modules/etc/gm/addons"
+MENUDIR="$HOME/Library/GRASS/$GRASS_MMVER/Modules/etc"
echo "Rebuilding Addon menu..."
+# clean up old .menu files
+if [ -d "$MENUDIR/gm/addons" ] ; then
+ rm -f "$MENUDIR/gm/addons/"*".menu"
+fi
+
+# just to make sure (startup should have created it)
mkdir -p "$MENUDIR"
-rm -f "$MENUDIR/"*.menu
+echo "# generated by grass startup" > "$MENUDIR/xtnmenu.dat"
# global addons:
if [ -d "$BINDIRG" ] ; then
@@ -29,18 +34,21 @@
else
CMDLISTG=""
fi
+CMDGFOUND=""
if [ "$CMDLISTG" != "" ] ; then
for i in $CMDLISTG
do
ftype="`file $BINDIRG/$i`"
if [ "`echo $ftype | grep 'Mach-O'`" ] || [ "`grep '#% *Module' $BINDIRG/$i`" ] ; then
- echo "command {[G_msg \"$i\"]} {} \"$i\" {} -command {execute $i }" > $MENUDIR/$i.menu
+ echo "main:$i:$i:$i" >> "$MENUDIR/xtnmenu.dat"
+ CMDGFOUND="1"
fi
done
fi
-# user addons pages:
+# user addons:
+CMDFIRST="1"
cd "$BINDIR"
CMDLIST=`ls -1 2> /dev/null | sort -u`
@@ -49,7 +57,11 @@
do
ftype="`file $BINDIR/$i`"
if [ "`echo $ftype | grep 'Mach-O'`" ] || [ "`grep '#% *Module' $BINDIR/$i`" ] ; then
- echo "command {[G_msg \"$i\"]} {} \"$i\" {} -command {execute $i }" > $MENUDIR/$i.menu
+ if [ "$CMDFIRST" ] && [ "$CMDGFOUND" ] ; then
+ echo "separator" >> "$MENUDIR/xtnmenu.dat"
+ CMDFIRST=""
+ fi
+ echo "main:$i:$i:$i" >> "$MENUDIR/xtnmenu.dat"
fi
done
fi
More information about the grass-commit
mailing list