[GRASS5] cd $LOCATION revisited

Glynn Clements glynn.clements at virgin.net
Fri Jan 16 20:51:58 EST 2004


Markus Neteler wrote:

> > I don't have any trick or modification - Jaro has explained it to me -
> > when you start GRASS with tcltk interface the variables get set up and
> > it works as written above. 
> > If you start with -text then I get what you have described 
> > as standard version. So far on the machines where I have tried it
> > it works like this without any tricks 
> 
> For me it's strange if, depending how GRASS was started, $LOCATION
> is set or not. Guess that this should be fixed.

That behaviour is due to the following in gis_set.tcl:

    button .frame0.frameBUTTONS.ok \
     	-text [G_msg "Use Selection"] \
    	-relief raised \
     	-padx 10 \
     	-command { 
            if { $mapset != "" } {
            	CheckLocation
                puts stdout "GISDBASE='$database'; export GISDBASE;"
                puts stdout "LOCATION_NAME='$location'; export LOCATION_NAME;"
                puts stdout "MAPSET='$mapset'; export MAPSET;"
                if {[string compare $location "##ERROR##"] != 0} {
		    putGRASSRC $gisrc_name
		}
		destroy .
            } 
        }

    button .frame0.frameBUTTONS.newLoc \
    	-text [G_msg "Create New Location"] \
    	-relief raised \
    	-padx 10 \
    	-command {
            puts stdout "OLD_DB='$oldDb';"
            puts stdout "OLD_LOC='$oldLoc';"
            puts stdout "OLD_MAP='$oldMap';"
	    puts stdout "GISDBASE='$database'; export GISDBASE;"
    	    puts stdout "LOCATION_NAME='##NONE##'; export LOCATION_NAME;"
            puts stdout "MAPSET=''; export MAPSET;"
            set location ""
	    set mapset ""
	    putGRASSRC $gisrc_name
	    destroy . 
      	}

The "export" commands shouldn't be there.

-- 
Glynn Clements <glynn.clements at virgin.net>




More information about the grass-dev mailing list