[pycrypto] configure, PATH, and setup.py
Robin Jarry
robin.jarry at 6wind.com
Thu Apr 3 00:18:50 PDT 2014
Hello John,
This sounded weird so I ran some tests. If you have a <script> in the
current directory (even if "." is not in the PATH) it has priority when
calling it with sh <script>.
*robin at tom:~$ path*
/home/robin/bin
/usr/local/bin
/usr/bin
/bin
*robin at tom:~$ which test*
test is /usr/local/bin/test
*robin at tom:~$ cat /usr/local/bin/test*
#!/bin/sh
echo "IN PATH"
*robin at tom:~$ cat ~/test*
#!/bin/sh
echo "LOCAL"
*robin at tom:~$ test*
IN PATH
*robin at tom:~$ ./test*
LOCAL
*robin at tom:~$ sh test*
LOCAL
Maybe you are experiencing another problem.
Robin
On Wed, Apr 2, 2014 at 10:17 PM, John Palmieri <jhpalmieri64 at gmail.com>wrote:
> I have a patch to suggest. Both on a linux system and an OS X system that
> I have access to, if my PATH contains another script called "configure",
> then pycrypto fails to configure properly, because the line "sh configure"
> finds that other configure script rather than the pycrypto one. So could
> that command be changed? For example:
>
> $ git diff
> diff --git a/setup.py b/setup.py
> index 5269e9d..950d352 100644
> --- a/setup.py
> +++ b/setup.py
> @@ -308,7 +308,7 @@ class PCTBuildConfigure(Command):
> os.chmod("configure", stat.S_IRUSR | stat.S_IWUSR |
> stat.S_IXUSR | stat.S_IRGRP | stat.S_IXGRP |
> stat.S_IROTH | stat.S_IXOTH)
> - cmd = "sh configure" # we use "sh" here so that it'll work
> on mingw32 with standard python.org binaries
> + cmd = "sh ./configure" # we use "sh" here so that it'll
> work on mingw32 with standard python.org binaries
> if self.verbose < 1:
> cmd += " -q"
> if os.system(cmd) != 0:
>
> or (maybe more portable):
>
> $ git diff
> diff --git a/setup.py b/setup.py
> index 5269e9d..77fb2b0 100644
> --- a/setup.py
> +++ b/setup.py
> @@ -308,7 +308,7 @@ class PCTBuildConfigure(Command):
> os.chmod("configure", stat.S_IRUSR | stat.S_IWUSR |
> stat.S_IXUSR | stat.S_IRGRP | stat.S_IXGRP |
> stat.S_IROTH | stat.S_IXOTH)
> - cmd = "sh configure" # we use "sh" here so that it'll work
> on mingw32 with standard python.org binaries
> + cmd = "sh %s" % (os.path.join(os.curdir, 'configure')) # we
> use "sh" here so that it'll work on mingw32 w
> if self.verbose < 1:
> cmd += " -q"
> if os.system(cmd) != 0:
>
> I have no experience with Windows, for example, so I don't know how
> portable this kind of change would be.
>
> --
> John H. Palmieri
>
>
> _______________________________________________
> pycrypto mailing list
> pycrypto at lists.dlitz.net
> http://lists.dlitz.net/cgi-bin/mailman/listinfo/pycrypto
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.dlitz.net/pipermail/pycrypto/attachments/20140403/d4508367/attachment.html>
More information about the pycrypto
mailing list