[Live-demo] Spatialite on version 6.0

Hamish hamish_b at yahoo.com
Fri May 11 20:44:09 PDT 2012


Micha wrote:
>  I've put together a new install_spatialite.sh script [1] which
>   downloads and compiles the whole spatialite suite. It seems to be
>   working well on a VM of the alpha1 build that Angelos has
>   prepared. Before I suggest to push it into the build scripts, can
>   others have a look, and try it out so the bugs surface?

Hi, just some general pointers about the install scripts, none of them
are bugs or really of particular importance, but..


curly bracket quoting like ${FOO} does not add to safety! actually
it hurts it as it gives a false impression that it is doing something,
so makes real bugs harder to spot. The main place you'd use that is
to protect the variable name from following chars like "${FOO}_bar"
or where it justifiably aids readability. "." and "/" are not valid
parts of enviro variable names so you don't need ${} if they are the
following chars.

In general I try to avoid+remove them as it just propagates the false
notion that you are protected from spaces etc. in e.g. filename variables
when you are in fact not. and basing decisions on bad assumptions can be
quite dangerous when you move on to future scripts.


perhaps a matter of taste, but if the tarball is versioned it's usually
enough to use 'wget -c'. 'wget -N' is perhaps more useful when the tarball
does not contain a version in it and all we have to go in is the file's
timestamp.



use 
  if [ "a" = "b" ] ; then
instead of
  if [ "a" == "b" ] ; then

as the latter is a bashism. the script doesn't seem to use arrays[] or
similar extensions mandating bash, so for the sake of the minor tweak
it's better to make it #!/bin/sh (dash) compatible.



please put custom *.desktop files into /usr/local/share/applications/
instead of /usr/share/applications/ so it is easy for us to separate
our mods from the official packaging. same for icons. GNOME etc will
look in both places, even if the local one didn't exist yet.
exception: anything installed via a more or less official .deb should
go into /usr not /usr/local


thanks,
Hamish



More information about the Osgeolive mailing list