Opened 15 years ago

Closed 15 years ago

#890 closed defect (fixed)

shell scripts: %TMP% namespace collision

Reported by: hamish Owned by: grass-dev@…
Priority: major Milestone: 6.4.0
Component: Default Version: svn-releasebranch64
Keywords: wingrass, shell scripts Cc:
CPU: All Platform: MSWindows XP

Description

Hi,

  • MS-Windows sets %TMP%
  • MSys translates existing DOS variables into shell variables
  • %TMP% becomes $TMP
  • many shell scripts use TMP=`g.tempfile -p $$`
  • many shell scripts try to remove $TMP* files even if they don't exist.
  • potential ka-boom if g.tempfile never ran

I just triggered this with a typo: m.proj hlep

should we unset TMP at the start of any script which uses it?

d.polar
db.dropcol
i.fusion.brovey
m.proj
r.in.wms
r.mask
r.plane
r.regression.line
r.univar.sh
v.colors
v.db.dropcol
v.db.renamecol
v.db.univar
v.in.garmin
v.in.gpsbabel
v.in.lines
v.in.mapgen
v.in.wfs
v.out.gpsbabel
v.rast.stats
v.univar.sh

or should we do that as part of WinGrass's Init.sh?

Hamish

Change History (8)

in reply to:  description comment:1 by glynn, 15 years ago

Replying to hamish:

should we unset TMP at the start of any script which uses it?

Use a different variable.

or should we do that as part of WinGrass's Init.sh?

No. That would cause problems for anything which expects it to be set. As would changing its value.

comment:2 by hamish, 15 years ago

d.polar, db.dropcol, i.fusion.brovey, and m.proj done in 6.5svn with r40686.

r.in.wms, r.mask, r.plane, r.regression.line, r.univar.sh done in 6.5svn with r40687.

v.* still needs it.

comment:3 by hamish, 15 years ago

v.* done in 6.5svn with r40689 and r40690.

comment:4 by hamish, 15 years ago

backport this to relbr6.4 before or after rc6?

Hamish

in reply to:  4 comment:5 by neteler, 15 years ago

Replying to hamish:

backport this to relbr6.4 before or after rc6?

Please (let's) do it before RC6 to avoid a RC7...

Markus

in reply to:  description comment:6 by glynn, 15 years ago

Replying to hamish:

v.dissolve and v.in.mapgen weren't listed but also use $TMP. I've fixed these in 6.5 with r41338.

comment:7 by neteler, 15 years ago

Bulk-backport of r40686, r40687, r40689, r40690, r41338 in GRASS 6.4 as r41340.

Markus

comment:8 by hamish, 15 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.