[GRASS-dev] Re: [GRASS-user] g.extension and GRASS 6.4.1

Hamish hamish_b at yahoo.com
Fri May 13 05:39:08 EDT 2011


Hi,

Hamish wrote:
> note there is still a minor difference between g.extension(.sh)
> in 6.4.svn and 6.5.svn, the default install dir (prefix) is
> given as $GRASS_ADDON_PATH in 6.5 while $GISBASE in 6.4.
> 
> For package-installs GISBASE is most probably readonly, so
> GRASS_ADDON_PATH needs to be used. Note that code already exists
> in the script to deal with the case when GRASS_ADDON_PATH does
> not exist yet. As William points out GRASS_ADDON_PATH needs
> `cut -f1 -d:` or so applied, but that seems manageable.

any comments before I make it the first dir in $GRASS_ADDON_PATH in the
6.4 branch?

 
> also, what was the need for using the -f flag with `ln`? It seems
> rather dangerous to me. If the user already has a file there the
> script needs to exit with an error instead of deleting their
> prior work without asking.

-f removed in 6.5 and 6.4 in r46253,4.
If the reason was to avoid an ugly error message, it's easy enough to
catch that with if [ $? -ne 0 ] ; and `g.message -w` something nicer.



also, the quoting on this line is broken:
-      su -c "make MODULE_TOPDIR="$GISBASE" INST_DIR="$MYINST_DIR" install"
+      su -c "make MODULE_TOPDIR="$GISBASE" ARCH_DISTDIR="$TMPDIR/dist" INST_DIR="$MYINST_DIR" install"


the " do not nest. They are read from left to right. e.g.:
$ DIRN="a b"
$ su -c "mkdir "$DIRN/" c/"
Unknown id: b/ c/
$ su -c "mkdir \"$DIRN/\" c/"
Password:
$ ls -F
a b/  c/

fixed in r46255,6.


wrt when GRASS_ADDON_PATH contains multiple entries, in r46257,8 I've set
it to just take the first one.
Mac-- William: would it be better to grab the last one?
WinGrass-- will the MSYS path ever contain C:\ ?



finally we should consider what happens on Ubuntu and possibly OSX where
by default there is no root pw & sudo is used; and if we should test for
MSYS and issue a no-op warning there for the -s flag.




see also these 2 relevant tickets:
 https://trac.osgeo.org/grass/ticket/620
    "Platform.make odd variables settings"

 https://trac.osgeo.org/grass/ticket/1180
    "g.extension fails on install step when GRASS is launched from source directory"


best,
Hamish



More information about the grass-dev mailing list