Subject: #!/usr/pkg/bin/python doesn't work with pkg_alternatives?
To: None <tech-pkg@netbsd.org>
From: Ian D. Leroux <ian_leroux@fastmail.fm>
List: tech-pkg
Date: 01/31/2005 22:42:28
The subject line says it all: since the pkg_alternatives wrapper script
is itself a #!/bin/sh script, and since execve(2) only goes through one
such indirection, python scripts starting with #!/usr/pkg/bin/python get
treated as shell scripts, with predictably erratic consequences.  So is
this usage deprecated or is there an accepted solution?  The package
lang/python (now defunct) didn't have this problem because it used a
symlink instead of a wrapper script.

The workaround I know about is to do
#!/usr/bin/env python
(or to explicitly specify the version as #!/usr/pkg/bin/python24
for example).

Thanks,

Ian Leroux