[GRASS-dev] [grass-code I][502] Grass 6.3 fails to apply database connection changes via db.connect

Moritz Lennert mlennert at club.worldonline.be
Fri Oct 5 10:02:57 EDT 2007



On 05/10/07 15:28, grass-dev at grass.itc.it wrote:
> code I item #502, was opened at 2007-10-05 10:28 Status: Open 
> Priority: 3 Submitted By: Eric Patton (eric) Assigned to: Nobody
> (None) Summary: Grass 6.3 fails to apply database connection changes
> via db.connect Issue type: module bug Issue status: None GRASS
> version: CVS HEAD GRASS component: None Operating system: Linux 
> Operating system version: Ubuntu 7.04 GRASS CVS checkout date, if
> applies (YYMMDD): 071005
> 
> 
> Initial Comment: I noticed that Grass 6.3 cvs doesn't 'remember' the
> database changes that were applied during the last session:
> 


Markus wrote:
> Absolutely. I was also suprised yesterday and added a workaround
> in lib/init/init.sh (to restore DBF if the VAR file is missing).
> But I wonder what is deleting this file. This is a pretty new bug.

I actually have the feeling that your workaround actually is the 
problem. You added this to init.sh:

# predefine DBF driver if DB connection not defined
echo "DB_DRIVER: dbf" > "$LOCATION/VAR"
echo "DB_DATABASE: \$GISDBASE/\$LOCATION_NAME/\$MAPSET/dbf/" >> 
"$LOCATION/VAR"
mkdir "$LOCATION"/dbf


But I don't see any conditioning around this, so IIUC driver and 
database will always be set to dbf of the mapset at each startup. It 
probably needs a test for the dbf directory around it. Something like 
(not a bash expert):

if [ ! -e  $GISDBASE/$LOCATION_NAME/$MAPSET/dbf/];
   then
    echo "DB_DRIVER: dbf" > "$LOCATION/VAR"
    echo "DB_DATABASE: \$GISDBASE/\$LOCATION_NAME/\$MAPSET/dbf/" >> 
"$LOCATION/VAR"
    mkdir "$LOCATION"/dbf
fi

Moritz




More information about the grass-dev mailing list