Opened 10 years ago

Closed 10 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)

comment:1 in reply to:  description Changed 10 years ago by glynn

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 Changed 10 years ago by hamish

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 Changed 10 years ago by hamish

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

comment:4 Changed 10 years ago by hamish

backport this to relbr6.4 before or after rc6?

Hamish

comment:5 in reply to:  4 Changed 10 years ago by neteler

Replying to hamish:

backport this to relbr6.4 before or after rc6?

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

Markus

comment:6 in reply to:  description Changed 10 years ago by glynn

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 Changed 10 years ago by neteler

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

Markus

comment:8 Changed 10 years ago by hamish

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