[GRASS-dev] Re: [GRASS-SVN] r40713 - grass/branches/develbranch_6/lib/gis

While backporting below, I found this unported change 6.5 -> 6.4:

@@ -1989,7 +1998,7 @@

     sprintf(script, "%s/etc/wxpython/gui_modules/menuform.py",
       getenv("GISBASE"));
- G_spawn(getenv("GRASS_PYTHON"), "menuform.py", script, pgm_name, NULL);
+ G_spawn(getenv("GRASS_PYTHON"), getenv("GRASS_PYTHON"), script,
pgm_name, NULL);
}

Also backport?

Markus

On Thu, Jan 28, 2010 at 1:23 AM, <svn_grass@osgeo.org> wrote:

Author: glynn
Date: 2010-01-27 19:23:21 -0500 (Wed, 27 Jan 2010)
New Revision: 40713

Modified:
grass/branches/develbranch_6/lib/gis/parser.c
Log:
Quote $GRASS_WISH

Modified: grass/branches/develbranch_6/lib/gis/parser.c

--- grass/branches/develbranch_6/lib/gis/parser.c 2010-01-28 00:22:02 UTC (rev 40712)
+++ grass/branches/develbranch_6/lib/gis/parser.c 2010-01-28 00:23:21 UTC (rev 40713)
@@ -1964,14 +1964,14 @@

#ifdef __MINGW32__
if (getenv("GRASS_DEBUG_GUI"))
- fp = G_popen("tee gui_dump.tcl | %GRASS_WISH%", "w");
+ fp = G_popen("tee gui_dump.tcl | \"%GRASS_WISH%\"", "w");
else
- fp = G_popen("%GRASS_WISH%", "w");
+ fp = G_popen("\"%GRASS_WISH%\"", "w");
#else
if (getenv("GRASS_DEBUG_GUI"))
- fp = G_popen("tee gui_dump.tcl | $GRASS_WISH", "w");
+ fp = G_popen("tee gui_dump.tcl | '$GRASS_WISH'", "w");
else
- fp = G_popen("$GRASS_WISH", "w");
+ fp = G_popen("'$GRASS_WISH'", "w");
#endif

if \(\!fp\)

_______________________________________________
grass-commit mailing list
grass-commit@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-commit

Markus Neteler wrote:

While backporting below, I found this unported change 6.5 -> 6.4:

@@ -1989,7 +1998,7 @@

     sprintf(script, "%s/etc/wxpython/gui_modules/menuform.py",
       getenv("GISBASE"));
- G_spawn(getenv("GRASS_PYTHON"), "menuform.py", script, pgm_name, NULL);
+ G_spawn(getenv("GRASS_PYTHON"), getenv("GRASS_PYTHON"), script,
pgm_name, NULL);
}

Also backport?

May as well.

This is a workaround for a Gentoo bug. On Gentoo, "python" is a
launcher which invokes the "active" version of Python. Unfortunately,
it cares about argv[0].

The change causes the invocation to mirror normal execution of a
script from the shell (i.e. argv[0] is set to the name of the
interpreter).

Even without the change, the Gentoo bug can be worked around by
setting GRASS_PYTHON to the specific Python interpreter (e.g.
"python2.6") rather than the launcher ("python").

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

On Thu, Jan 28, 2010 at 2:50 PM, Glynn Clements
<glynn@gclements.plus.com> wrote:

Markus Neteler wrote:

While backporting below, I found this unported change 6.5 -> 6.4:

@@ -1989,7 +1998,7 @@

 sprintf\(script, &quot;%s/etc/wxpython/gui\_modules/menuform\.py&quot;,
      getenv\(&quot;GISBASE&quot;\)\);

- G_spawn(getenv("GRASS_PYTHON"), "menuform.py", script, pgm_name, NULL);
+ G_spawn(getenv("GRASS_PYTHON"), getenv("GRASS_PYTHON"), script,
pgm_name, NULL);
}

Also backport?

May as well.

This is a workaround for a Gentoo bug. On Gentoo, "python" is a
launcher which invokes the "active" version of Python. Unfortunately,
it cares about argv[0].

The change causes the invocation to mirror normal execution of a
script from the shell (i.e. argv[0] is set to the name of the
interpreter).

Even without the change, the Gentoo bug can be worked around by
setting GRASS_PYTHON to the specific Python interpreter (e.g.
"python2.6") rather than the launcher ("python").

OK, done in r40722 to attract more Gentoo users.

Markus