[GRASS-dev] [grass-code I][381] r.colors rules: some scripts broken

Hamish hamish_nospam at yahoo.com
Thu May 3 02:07:29 EDT 2007

> code I item #381, was opened at 2007-04-25 19:24
> Summary: r.colors rules: some scripts broken 
> Eg. in GRASS 6.3 scripts dir:
> i.in.spotvgt: 213: r.colors ${NAME} rules=ndvi 2>&1 >/dev/null
> i.in.spotvgt: 275: r.colors ${NAME}_filt rules=ndvi 2>&1 >/dev/null
> r.in.srtm: 237: r.colors rul=srtm map=$TILEOUT
> Such syntax leads now to "ERROR: Unable to load rules file srtm".
> How do we fix it? Add the $GISBASE/etc/colors/ before the rule name?
> Looks like a broken backwards compatibility...

[cc'd from the tracker]

r.colors was changed in 6.3 CVS,

Revision 2.14, Sat Apr 14 03:35:32 2007 UTC by glynn 
 Merge rules= with color=
 Use rules= for external rules file

you can get rid of the errors by changing "r.colors rules="
to "r.colors color=". I've just done this for r.in.srtm.

But really this will break a lot of scripts and should be revisited
to be backwards compatible. Suggestion: when it looks for the rules
file it should try looking for $GISBASE/etc/colors/$RULEFILE if it
can't find the file as just $RULEFILE.

Anything written using "r.colors rules=" will be affected.


More information about the grass-dev mailing list