[GRASS-SVN] r56413 - grass/branches/releasebranch_6_4/macosx/app

svn_grass at osgeo.org svn_grass at osgeo.org
Sat May 25 10:27:44 PDT 2013


Author: kyngchaos
Date: 2013-05-25 10:27:44 -0700 (Sat, 25 May 2013)
New Revision: 56413

Modified:
   grass/branches/releasebranch_6_4/macosx/app/build_gui_user_menu.sh
   grass/branches/releasebranch_6_4/macosx/app/grass.sh.in
Log:
handle script extensions, more for #854

Modified: grass/branches/releasebranch_6_4/macosx/app/build_gui_user_menu.sh
===================================================================
--- grass/branches/releasebranch_6_4/macosx/app/build_gui_user_menu.sh	2013-05-25 17:24:20 UTC (rev 56412)
+++ grass/branches/releasebranch_6_4/macosx/app/build_gui_user_menu.sh	2013-05-25 17:27:44 UTC (rev 56413)
@@ -13,7 +13,9 @@
 
 GRASS_MMVER=`cut -d . -f 1-2 "$GISBASE/etc/VERSIONNUMBER"`
 BINDIR="$HOME/Library/GRASS/$GRASS_MMVER/Modules/bin"
+SCRIPTDIR="$HOME/Library/GRASS/$GRASS_MMVER/Modules/scripts"
 BINDIRG="/Library/GRASS/$GRASS_MMVER/Modules/bin"
+SCRIPTDIRG="/Library/GRASS/$GRASS_MMVER/Modules/scripts"
 MENUDIR="$HOME/Library/GRASS/$GRASS_MMVER/Modules/etc"
 
 echo "Rebuilding Addon menu..."
@@ -30,17 +32,26 @@
 # global addons:
 if [ -d "$BINDIRG" ] ; then
   cd "$BINDIRG"
-  CMDLISTG=`ls -1 2> /dev/null | sort -u`
+  CMDLISTG=`ls -1 2> /dev/null`
 else
   CMDLISTG=""
 fi
+if [ -d "$SCRIPTDIRG" ] ; then
+  cd "$SCRIPTDIRG"
+  CMDLISTG="$CMDLISTG"$'\n'"`ls -1 2> /dev/null`"
+fi
+CMDLISTG=`echo "$CMDLISTG" | sort -u`
 CMDGFOUND=""
 
 if [ "$CMDLISTG" != "" ] ; then
   for i in $CMDLISTG
   do
-    ftype="`file $BINDIRG/$i`"
-    if [ "`echo $ftype | grep 'Mach-O'`" ] || [ "`grep '#% *Module' $BINDIRG/$i`" ] ; then
+    if [ -f "$BINDIRG/$i" ] ; then
+      ftype="`file $BINDIRG/$i`"
+    else
+      ftype="`file $SCRIPTDIRG/$i`"
+    fi
+    if [ "`echo $ftype | grep 'Mach-O'`" ] || [ "`grep '#% *Module' $BINDIRG/$i 2> /dev/null`" ] || [ "`grep '#% *Module' $SCRIPTDIRG/$i 2> /dev/null`" ] ; then
       echo "main:$i:$i:$i" >> "$MENUDIR/xtnmenu.dat"
       CMDGFOUND="1"
     fi
@@ -50,13 +61,22 @@
 # user addons:
 CMDFIRST="1"
 cd "$BINDIR"
-CMDLIST=`ls -1 2> /dev/null | sort -u`
+CMDLIST=`ls -1 2> /dev/null`
+if [ -d "$SCRIPTDIR" ] ; then
+  cd "$SCRIPTDIR"
+  CMDLIST="$CMDLIST"$'\n'"`ls -1 2> /dev/null`"
+fi
+CMDLIST=`echo "$CMDLIST" | sort -u`
 
 if [ "$CMDLIST" != "" ] ; then
   for i in $CMDLIST
   do
-    ftype="`file $BINDIR/$i`"
-    if [ "`echo $ftype | grep 'Mach-O'`" ] || [ "`grep '#% *Module' $BINDIR/$i`" ] ; then
+    if [ -f "$BINDIR/$i" ] ; then
+      ftype="`file $BINDIR/$i`"
+    else
+      ftype="`file $SCRIPTDIR/$i`"
+    fi
+    if [ "`echo $ftype | grep 'Mach-O'`" ] || [ "`grep '#% *Module' $BINDIR/$i 2> /dev/null`" ] || [ "`grep '#% *Module' $SCRIPTDIR/$i 2> /dev/null`" ] ; then
       if [ "$CMDFIRST" ] && [ "$CMDGFOUND" ] ; then
         echo "separator" >> "$MENUDIR/xtnmenu.dat"
         CMDFIRST=""

Modified: grass/branches/releasebranch_6_4/macosx/app/grass.sh.in
===================================================================
--- grass/branches/releasebranch_6_4/macosx/app/grass.sh.in	2013-05-25 17:24:20 UTC (rev 56412)
+++ grass/branches/releasebranch_6_4/macosx/app/grass.sh.in	2013-05-25 17:27:44 UTC (rev 56413)
@@ -41,26 +41,30 @@
 
 # add some OS X style app support paths, and create user one if missing.
 mkdir -p "$GISBASE_USER/Modules/bin"
+mkdir -p "$GISBASE_USER/Modules/scripts"
+addpath="$GISBASE_USER/Modules/bin:$GISBASE_USER/Modules/scripts:$GISBASE_SYSTEM/Modules/bin:$GISBASE_SYSTEM/Modules/scripts"
 if [ "$GRASS_ADDON_PATH" ] ; then
-	GRASS_ADDON_PATH="$GRASS_ADDON_PATH:$GISBASE_USER/Modules/bin:$GISBASE_SYSTEM/Modules/bin"
+	GRASS_ADDON_PATH="$GRASS_ADDON_PATH:$addpath"
 else
-	GRASS_ADDON_PATH="$GISBASE_USER/Modules/bin:$GISBASE_SYSTEM/Modules/bin"
+	GRASS_ADDON_PATH="$addpath"
 fi
 export GRASS_ADDON_PATH
 
 mkdir -p "$GISBASE_USER/Modules/etc"
+addpath="$GISBASE_USER/Modules/etc:$GISBASE_SYSTEM/Modules/etc"
 if [ "$GRASS_ADDON_ETC" ] ; then
-	GRASS_ADDON_ETC="$GRASS_ADDON_ETC:$GISBASE_USER/Modules/etc:$GISBASE_SYSTEM/Modules/etc"
+	GRASS_ADDON_ETC="$GRASS_ADDON_ETC:$addpath"
 else
-	GRASS_ADDON_ETC="$GISBASE_USER/Modules/etc:$GISBASE_SYSTEM/Modules/etc"
+	GRASS_ADDON_ETC="$addpath"
 fi
 export GRASS_ADDON_ETC
 
 mkdir -p "$GISBASE_USER/Modules/lib"
+addpath="$GISBASE_USER/Modules/lib:$GISBASE_SYSTEM/Modules/lib"
 if [ "$DYLD_LIBRARY_PATH" ] ; then
-	DYLD_LIBRARY_PATH="$GISBASE_USER/Modules/lib:$GISBASE_SYSTEM/Modules/lib:$DYLD_LIBRARY_PATH"
+	DYLD_LIBRARY_PATH="$addpath:$DYLD_LIBRARY_PATH"
 else
-	DYLD_LIBRARY_PATH="$GISBASE_USER/Modules/lib:$GISBASE_SYSTEM/Modules/lib"
+	DYLD_LIBRARY_PATH="$addpath"
 fi
 export DYLD_LIBRARY_PATH
 



More information about the grass-commit mailing list