[GRASS-dev] Re: g.mlist, g.mremove fails in non-English locale
Hamish
hamish_b at yahoo.com
Mon Apr 7 03:44:50 EDT 2008
> >> In this locale g.mlist is broken. Eg. the command:
...
> >> It looks that the Polish translation "raster plików dostêpnych w
> >> mapsecie <PERMANENT>:", used in g.list, gets mixed into g.mlist
> >> output.
>
> >> What's wrong?
Hamish:
> > The g.mlist script relies on the g.list module being run
> > untranslated.
Ivan:
> - g.list ...
> + LC_ALL=C g.list ...
thanks, committed in r30881 and backported to 6.3.0 in r30882.
many other modules use grep, but g.mlist was/is the worst script for
depending on module decorations. Others to consider are ones that parse
'd.mon -L', g.region without -g, and 'db.connect -p'. I haven't checked
if any of those three use i18n macros. Of them db.connect shouldn't IMO.
Anyway when we come across them the fix is easy to implement. (I don't
like an "apply to all scripts" solution)
> > The long term fix is to rewrite g.mlist not to be a hack.
>
> It's rather `g.list' that should be extended to output in
> machine-readable form. (I've already suggested the `-1' and
> `--no-decoration' options to achieve that, though I haven't
> prepared a patch as of yet.)
right. I wonder how to deal with multiple mapsets? fully qualify
name at mapset for all map names or use a #header line with the mapset name
before each new mapset listing? Probably fully qualify everything: it's
easy enough to strip off the mapset with 's/@.*$//' or `cut -f1 -d@` and
much less weird to deal with.
FWIW g.mlist just gives you all map names without qualification, but they
will be in the mapset search path so it only becomes an issue if you have
multiple maps of the same name in the mapset search path.
(g.mremove explicitly limits itself to maps in the current mapset. It
could use 'g.mlist mapset=.' instead of 'g.mlist mapset=`g.gisenv
MAPSET`' but that's just cosmetic)
I worry about using -1 and -l as they can be confused depending on the
font; for many other modules we have used -g to tell the module to create
parsable output. (why -g? I've no idea. but so it is)
Hamish
____________________________________________________________________________________
You rock. That's why Blockbuster's offering you one month of Blockbuster Total Access, No Cost.
http://tc.deals.yahoo.com/tc/blockbuster/text5.com
More information about the grass-dev
mailing list