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

Glynn Clements glynn at gclements.plus.com
Thu May 3 03:36:56 EDT 2007


Hamish wrote:

> http://wald.intevation.org/tracker/?func=detail&atid=204&aid=381&group_id=21
> ..
> > 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 
> ..
> r.colors:
> ..
>  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.

When I added rules=, it was made clear that this was a temporary
feature until it could replace color=.

As there hasn't been a 6.3.0 release yet, the 6.3 API remains subject
to change.

-- 
Glynn Clements <glynn at gclements.plus.com>




More information about the grass-dev mailing list