[GRASS-dev] Re: g.mlist, g.mremove fails in non-English locale

Ivan Shmakov ivan at theory.asu.ru
Mon Apr 7 02:21:27 EDT 2008


>>>>> Hamish  <hamish_b at yahoo.com> writes:

[...]

 >> In this locale g.mlist is broken. Eg. the command:

 >> g.mlist rast pat=* sep=,

 >> prints the following:

[...]

 >> 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?

 > The g.mlist script relies on the g.list module being run
 > untranslated.

 > The immediate fix is to add a couple of lines to the start of the
 > script temporarily disabling the locale settings, much like is done
 > for scripts that use awk to stop "," being used as the decimal
 > marker.

	It's not even a couple of lines.  Just prepending `LC_ALL=C' to
	`g.list' should do the trick, e. g.:

- g.list ...
+ LC_ALL=C g.list ...

 > 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.)



More information about the grass-dev mailing list