[GRASS-dev] [GRASS-CVS] hamish: grass6/lib/init init.sh, 1.119,
1.120
Markus Neteler
neteler at itc.it
Mon Oct 8 16:07:03 EDT 2007
HamishB wrote:
>
> Markus Neteler wrote:
>> > Author: hamish
> ..
>> > Modified Files:
>> > init.sh
>> > Log Message:
>> > add test so don't overwrite VAR file without testing. I just
>> > commented the whole thing out though after fixing it, as the VAR and
>> > $MAPSET/dbf/ should be created on demand. To a raster-only or
>> > postgres-only user they are just file pollution. code bug #502
>> >
>> > Index: init.sh
>> > ===================================================================
>> > RCS file: /grassrepository/grass6/lib/init/init.sh,v
>> > retrieving revision 1.119
>> > retrieving revision 1.120
>> > diff -u -d -r1.119 -r1.120
>> > --- init.sh 3 Oct 2007 08:30:48 -0000 1.119
>> > +++ init.sh 6 Oct 2007 05:04:58 -0000 1.120
>> > @@ -495,9 +495,10 @@
>> > cp "$GISDBASE/$LOCATION_NAME/PERMANENT/WIND"
>> > "$LOCATION/WIND" echo "Missing WIND file fixed"
>> > # predefine DBF driver
>> > - echo "DB_DRIVER: dbf" > "$LOCATION/VAR"
>> > - echo "DB_DATABASE: \$GISDBASE/\
>> > $LOCATION_NAME/\$MAPSET/dbf/" >> "$LOCATION/VAR"
>> > - mkdir "$LOCATION"/dbf
>> > + # why is this needed ??
>> > + #echo "DB_DRIVER: dbf" > "$LOCATION/VAR"
>> > + #echo "DB_DATABASE: \$GISDBASE/\
>> > $LOCATION_NAME/\$MAPSET/dbf/" >> "$LOCATION/VAR"
>> > + #mkdir "$LOCATION"/dbf
>>
> Markus:
>> This is needed, if you start GRASS from CMD line with
>> full path to a non-existing mapset (which is then created).
>> So this should be restored somehow.
>
> so
>
> #typo
> user:~ $ grass63 grassdata/spearfish60/user11
>
> Is meant to create:
> grassdata/spearfish60/user11/VAR
> grassdata/spearfish60/user11/WIND
> grassdata/spearfish60/user11/dbf/
>
>
> (current CVS makes the new mapset but not the VAR and dbf/)
>
> ?
>
Yes, because only then it becomes a valid mapset without subsequent
errors.
HamishB wrote:
>
> I would think we should throw an error if the mapset doesn't exist
> (typo), and some '-n' flag is needed to create a new mapset from the
> command line.
> ?
>
OK, sounds reasonable to me (less surprises in the script behaviour).
HamishB wrote:
>
> And don't create the VAR and dbf/ until needed. (why do those need to
> exist before any vector maps with tables are created?)
> ?
>
Because any db./v. command will fail if those aren't present. DBF is the
default (still). Costs only a very few bytes.
Alternatively, fix all commands to auto-create when VAR and dbf/ are needed
but I suspect that this would be lots of work. Better do it in one place
right
at the beginning (then we can also easily switch to SQLite as default DB
driver
in future.
Markus
--
View this message in context: http://www.nabble.com/Re%3A--GRASS-CVS--hamish%3A-grass6-lib-init-init.sh%2C-1.119%2C-1.120-tf4579018.html#a13103885
Sent from the Grass - Dev mailing list archive at Nabble.com.
More information about the grass-dev
mailing list