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

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

Hamish wrote:

finally we should consider what happens on Ubuntu and possibly OSX where
by default there is no root pw & sudo is used;

new -u flag added for that in 6.5svn r46259. haven't tested so didn't
backport to 6.4 yet.

and if we should test for MSYS and issue a no-op warning there for the -s
flag.

no idea.

Hamish

On May 13, 2011, at 4:39 AM, Hamish wrote:

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:\ ?

The user path is first, I think that's reasonable to default to

finally we should consider what happens on Ubuntu and possibly OSX where
by default there is no root pw & sudo is used;

I'm not sure what you mean. I've never had any problems running sudo, either directly in the terminal or from a script. It *always* asks for a password and you type in your login (admin) password, and it doesn't matter that root has a null password.

-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

Earth: "Mostly harmless"

- revised entry in the HitchHiker's Guide to the Galaxy

Hamish:

> finally we should consider what happens on Ubuntu and
> possibly OSX where by default there is no root pw & sudo
> is used;

William:

I'm not sure what you mean. I've never had any
problems running sudo, either directly in the terminal or
from a script. It *always* asks for a password and you
type in your login (admin) password, and it doesn't matter
that root has a null password.

I was talking about the -s flag which runs
  su -c "make ... install"

I don't remember if I notified the list or not, but I've now
added a -u flag to run
  sudo make ... install
instead, for those systems which need it.

so have you been running "sudo g.extension ..." ?

Hamish

On May 15, 2011, at 6:11 AM, Hamish wrote:

Hamish:

finally we should consider what happens on Ubuntu and
possibly OSX where by default there is no root pw & sudo
is used;

William:

I'm not sure what you mean. I've never had any
problems running sudo, either directly in the terminal or
from a script. It *always* asks for a password and you
type in your login (admin) password, and it doesn't matter
that root has a null password.

I was talking about the -s flag which runs
su -c "make ... install"

I don't remember if I notified the list or not, but I've now
added a -u flag to run
sudo make ... install
instead, for those systems which need it.

so have you been running "sudo g.extension ..." ?

No, i meant sudo for other things.

Hamish

_______________________________________________
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

"Those people who most want to rule people are, ipso-facto, those least suited to do it."

- A rule of the universe, from the HitchHiker's Guide to the Galaxy