[pycrypto] configure, PATH, and setup.py
John Palmieri
jhpalmieri64 at gmail.com
Thu Apr 3 08:24:32 PDT 2014
Here's what I see:
(pycrypto-2.6.1) [08:18]$ export PATH=/bin:/usr/bin
(pycrypto-2.6.1) [08:18]$ sh configure
(... seems to work fine, then I hit ctrl-C ...)
(pycrypto-2.6.1) [08:18]$ export PATH=/Users/palmieri/Desktop:$PATH
(pycrypto-2.6.1) [08:20]$ cat /Users/palmieri/Desktop/configure
#!/bin/sh
echo "IN PATH"
(pycrypto-2.6.1) [08:19]$ sh configure
configure: error: cannot find sources (src/pycrypto_compat.h) in
/Users/palmieri/Desktop or ..
So you're right in that the other configure script is not being run.
However, something is going wrong, for me, at least, when there is another
configure script in the path. Changing the command to "sh ./configure"
fixes it.
Could you test again by creating a dummy "configure" script elsewhere and
see what happens when you run "sh configure" while in the pycrypto
directory?
On Thu, Apr 3, 2014 at 12:18 AM, Robin Jarry <robin.jarry at 6wind.com> wrote:
> 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
>>
>>
>
> _______________________________________________
> pycrypto mailing list
> pycrypto at lists.dlitz.net
> http://lists.dlitz.net/cgi-bin/mailman/listinfo/pycrypto
>
>
--
John H. Palmieri
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.dlitz.net/pipermail/pycrypto/attachments/20140403/1521b609/attachment-0001.html>
More information about the pycrypto
mailing list