[GRASS-dev] another not quiet GRASS command

Hamish hamish_nospam at yahoo.com
Mon Sep 3 22:00:53 EDT 2007


Michael Barton wrote:
> An aside: g.mapset treats as an error (It says "ERROR", so I assume
> that it generates a non-zero exit code)

it does:  general/g.mapset/main.c
    /* TODO: this should be checked better (repeated '/' etc.) */
    if ( strcmp(mapset_old_path, mapset_new_path) == 0 )
        G_fatal_error ( _("%s is already the current mapset"),
mapset_new );


> a situation where the location and mapset are the current location and
> mapset. IMHO, this should not be an error. I guess it could be a
> "warning", but the module is operating correctly in that it is
> 'changing' to the location and mapset specified; these just happen to
> be the current one.

when the rectifying target is the current mapset, can you test for that
and just not run g.mapset at all? The fewer times g.mapset needs to be
called the better..


Hamish




More information about the grass-dev mailing list