this bug's URL: http://intevation.de/rt/webrt?serial_num=4368
---------------------------------------------------------------------
Subject: r.blend: overwrites the output instead of 'Error: map
exists.'
..
GRASS Version: 2006-04-23
As the title reads.
fixed in cvs. As map name is created dynamically the parser doesn't
catch it with "gisprompt = new,cell,raster" ("new," not "old,"!)
I used g.findfile as the test,
for MAP in r g b ; do
g.findfile elem=cell file=${GIS_OPT_OUTPUT}.$MAP > /dev/null
if [ $? -eq 0 ] ; then
echo "Raster map <${GIS_OPT_OUTPUT}.$MAP> already exists." 1>&2
exit 1
fi
done
a few other cleanups, metadata tweaks done as well.
Also, r.blend GUI misses the neat green progress bar.
This is because the module that creates the 100% is r.mapcalc which is
called by the script, not the GUI. The GUI parses G_percent(), not output
to stderr. No obvious solution.
Changing this bug to a wish:
g.parser should set (but not export) $GIS_OVERWRITE if the --o option
is passed to the script. Then we could test within the script.
alt, maybe better, we could test if
`g.gisenv get=OVERWRITE` -n && -eq 1 and then skip "exit 1" but keep the
warning. (be sure to read-only g.gisenv OVERWRITE)
see http://grass.ibiblio.org/grass61/manuals/html61_user/variables.html
Hamish