[MacPorts] #17620: Problem with Installing python_select
#17620: Problem with Installing python_select -------------------------------------+-------------------------------------- Reporter: sean.b.palmer@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Port Bugs Component: ports | Version: 1.6.0 Keywords: | Port: -------------------------------------+-------------------------------------- When I try to install python_select, I get the following: * * * {{{ $ sudo port install python_select ---> Staging python_select into destroot Error: Target org.macports.destroot returned: shell command "/opt/local/var/macports/build /_opt_local_var_macports_sources_rsync.macports.org_release_ports_sysutils_python_select /work/destroot/opt/local/bin/python_select -i /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_sysutils_python_select /work/destroot python23-apple" returned error 12 Command output: /opt/local/var/macports/build /_opt_local_var_macports_sources_rsync.macports.org_release_ports_sysutils_python_select /work/destroot/opt/local/bin/python_select: line 124: [: /: unary operator expected ln: /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_sysutils_python_select /work/destroot/opt/local/Library/Frameworks/Python.framework/Resources: No such file or directory Unknown option: n Usage: head [-options] <url>... -m <method> use method for the request (default is 'HEAD') -f make request even if head believes method is illegal -b <base> Use the specified URL as base -t <timeout> Set timeout value -i <time> Set the If-Modified-Since header on the request -c <conttype> use this content-type for POST, PUT, CHECKIN -a Use text mode for content I/O -p <proxyurl> use this as a proxy -P don't load proxy settings from environment -H <header> send this HTTP header (you can specify several) -u Display method and URL before any response -U Display request headers (implies -u) -s Display response status code -S Display response status chain -e Display response headers -d Do not display content -o <format> Process HTML content in various ways -v Show program version -h Print this message -x Extra debugging output /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_sysutils_python_select /work/destroot/opt/local/bin/python_select: line 121: [: -: unary operator expected /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_sysutils_python_select /work/destroot/opt/local/bin/python_select: line 124: [: /: unary operator expected ln: /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_sysutils_python_select /work/destroot/opt/local/Library/Frameworks/Python.framework/Python: No such file or directory Error: Status 1 encountered during processing. }}} * * * When I tried to fix this by editing the problematic file, macports overwrote it on the next installation attempt. I suppose there's probably some way to get around that too, but either way this needs fixing upstream I presume. -- Ticket URL: <http://trac.macports.org/ticket/17620> MacPorts <http://www.macports.org/> Ports system for Mac OS
#17620: Problem with Installing python_select -------------------------------------+-------------------------------------- Reporter: sean.b.palmer@… | Owner: raimue@… Type: defect | Status: new Priority: Normal | Milestone: Port Bugs Component: ports | Version: 1.6.0 Keywords: | Port: python_select -------------------------------------+-------------------------------------- Changes (by macsforever2000@…): * cc: sean.b.palmer@… (removed) * owner: macports-tickets@… => raimue@… * port: => python_select Comment: Assigning to maintainer. -- Ticket URL: <http://trac.macports.org/ticket/17620#comment:2> MacPorts <http://www.macports.org/> Ports system for Mac OS
#17620: Problem with Installing python_select -------------------------------------+-------------------------------------- Reporter: sean.b.palmer@… | Owner: raimue@… Type: defect | Status: assigned Priority: Normal | Milestone: Port Bugs Component: ports | Version: 1.6.0 Keywords: | Port: python_select -------------------------------------+-------------------------------------- Changes (by raimue@…): * status: new => assigned Comment: Do I assume correctly you are installing on Tiger? -- Ticket URL: <http://trac.macports.org/ticket/17620#comment:3> MacPorts <http://www.macports.org/> Ports system for Mac OS
#17620: Problem with Installing python_select -------------------------------------+-------------------------------------- Reporter: sean.b.palmer@… | Owner: raimue@… Type: defect | Status: assigned Priority: Normal | Milestone: Port Bugs Component: ports | Version: 1.6.0 Keywords: | Port: python_select -------------------------------------+-------------------------------------- Comment(by sean.b.palmer@…): Replying to [comment:3 raimue@…]:
Do I assume correctly you are installing on Tiger?
Yep, indeed. Sorry, forgot to mention. -- Ticket URL: <http://trac.macports.org/ticket/17620#comment:4> MacPorts <http://www.macports.org/> Ports system for Mac OS
#17620: Problem with Installing python_select -------------------------------------+-------------------------------------- Reporter: sean.b.palmer@… | Owner: raimue@… Type: defect | Status: assigned Priority: Normal | Milestone: Port Bugs Component: ports | Version: 1.6.0 Keywords: | Port: python_select -------------------------------------+-------------------------------------- Comment(by raimue@…): You seem to have some binary named `head` in PATH which does not behave like the standard UNIX utility. According to the help message it looks like it is some tool to query a webserver over HTTP. `python_select` relies on head and tail being the standard tools. -- Ticket URL: <http://trac.macports.org/ticket/17620#comment:6> MacPorts <http://www.macports.org/> Ports system for Mac OS
#17620: Problem with Installing python_select -------------------------------------+-------------------------------------- Reporter: sean.b.palmer@… | Owner: raimue@… Type: defect | Status: assigned Priority: Normal | Milestone: Port Bugs Component: ports | Version: 1.6.0 Keywords: | Port: python_select -------------------------------------+-------------------------------------- Comment(by sean.b.palmer@…): The head binary is the standard unix utility: {{{ $ which head /usr/bin/head $ echo 'a\nb\nc' | head -n 1 a }}} There is also a HEAD utility as part of perl's lwp: {{{ $ HEAD -v This is lwp-request version 2.07 (libwww-perl-5.805) Copyright 1995-1999, Gisle Aas. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. }}} But that's "HEAD", not "head"... -- Ticket URL: <http://trac.macports.org/ticket/17620#comment:7> MacPorts <http://www.macports.org/> Ports system for Mac OS
#17620: Problem with Installing python_select -------------------------------------+-------------------------------------- Reporter: sean.b.palmer@… | Owner: raimue@… Type: defect | Status: assigned Priority: Normal | Milestone: Port Bugs Component: ports | Version: 1.6.0 Keywords: | Port: python_select -------------------------------------+-------------------------------------- Comment(by raimue@…): According to `port contents p5-libwww-perl`, my installation of lwp does not contain any binaries, only perl modules and man pages. Where does `HEAD` come from? What is the output of `port provides /opt/local/bin/HEAD`? Usually Mac OS X uses a case-insensitive filesystem. Therefore `head` and `HEAD` are treated the same. -- Ticket URL: <http://trac.macports.org/ticket/17620#comment:8> MacPorts <http://www.macports.org/> Ports system for Mac OS
#17620: Problem with Installing python_select -------------------------------------+-------------------------------------- Reporter: sean.b.palmer@… | Owner: raimue@… Type: defect | Status: assigned Priority: Normal | Milestone: Port Bugs Component: ports | Version: 1.6.0 Keywords: | Port: python_select -------------------------------------+-------------------------------------- Comment(by sean.b.palmer@…): {{{ $ which HEAD /opt/local/bin/HEAD $ port provides /opt/local/bin/HEAD /opt/local/bin/HEAD is not provided by a MacPorts port. }}} Presumably if I'd installed it myself it would be in /usr/local/bin, so I'm not sure how it came to be there. It's fairly old: {{{ $ ls -al /opt/local/bin/HEAD -r-xr-xr-x 1 root admin 14685 Mar 20 2007 /opt/local/bin/HEAD* }}} But I can't remember what circumstances might surround the installation. In any case, my shell managed to distinguish between the two correctly. How does it do so, if the filesystem is case-insensitive? Could MacPorts follow the same procedure to do so? -- Ticket URL: <http://trac.macports.org/ticket/17620#comment:9> MacPorts <http://www.macports.org/> Ports system for Mac OS
#17620: Problem with Installing python_select -------------------------------------+-------------------------------------- Reporter: sean.b.palmer@… | Owner: raimue@… Type: defect | Status: assigned Priority: Normal | Milestone: Port Bugs Component: ports | Version: 1.6.0 Keywords: | Port: python_select -------------------------------------+-------------------------------------- Comment(by sean.b.palmer@…): Replying to [comment:9 sean.b.palmer@…]:
In any case, my shell managed to distinguish between the two correctly.
A friend suggested the problem might only be in the root environment, and sure enough... {{{ $ sudo su ... # which head /opt/local/bin/head # which HEAD /opt/local/bin/HEAD }}} Which is strange, because my standard user $PATH is identical to the superuser $PATH, yet it works fine as standard user in zsh and not in the superuser shell, which is using sh by default. You get the same outcome in superuser zsh. Also, I wonder if the HEAD utility from lwp came from installing it using the MacPorts perl, but from CPAN. -- Ticket URL: <http://trac.macports.org/ticket/17620#comment:10> MacPorts <http://www.macports.org/> Ports system for Mac OS
#17620: Problem with Installing python_select -------------------------------------+-------------------------------------- Reporter: sean.b.palmer@… | Owner: raimue@… Type: defect | Status: assigned Priority: Normal | Milestone: Port Bugs Component: ports | Version: 1.6.0 Keywords: | Port: python_select -------------------------------------+-------------------------------------- Comment(by raimue@…): Replying to [comment:9 sean.b.palmer@…]:
But I can't remember what circumstances might surround the installation. In any case, my shell managed to distinguish between the two correctly. How does it do so, if the filesystem is case-insensitive? Could MacPorts follow the same procedure to do so?
In fact, python_select is a bash script. `/opt/local/bin/bash` does not distinguish between `head` and `HEAD`, neither does `/bin/bash`. I don't know which shell you use, but for bash it will not work. -- Ticket URL: <http://trac.macports.org/ticket/17620#comment:11> MacPorts <http://www.macports.org/> Ports system for Mac OS
#17620: Problem with Installing python_select -------------------------------------+-------------------------------------- Reporter: sean.b.palmer@… | Owner: raimue@… Type: defect | Status: assigned Priority: Normal | Milestone: Port Bugs Component: ports | Version: 1.6.0 Keywords: | Port: python_select -------------------------------------+-------------------------------------- Comment(by sean.b.palmer@…): Can the script be ported to sh? Or should I file a bash bug? (Or both?) -- Ticket URL: <http://trac.macports.org/ticket/17620#comment:14> MacPorts <http://www.macports.org/> Ports system for Mac OS
#17620: Problem with Installing python_select -------------------------------------+-------------------------------------- Reporter: sean.b.palmer@… | Owner: raimue@… Type: defect | Status: assigned Priority: Normal | Milestone: Port Bugs Component: ports | Version: 1.6.0 Keywords: | Port: python_select -------------------------------------+-------------------------------------- Comment(by raimue@…): This is not a bug in the shell. On a case-insensitive filesystem there is just no difference between `HEAD` and `head`. This is intended behavior. The only thing we could do is to hardcode a path into the shell script. But that would make it less portable. As a workaround, please remove `HEAD` from your PATH. -- Ticket URL: <http://trac.macports.org/ticket/17620#comment:15> MacPorts <http://www.macports.org/> Ports system for Mac OS
#17620: Problem with Installing python_select -------------------------------------+-------------------------------------- Reporter: sean.b.palmer@… | Owner: raimue@… Type: defect | Status: assigned Priority: Normal | Milestone: Port Bugs Component: ports | Version: 1.6.0 Keywords: | Port: python_select -------------------------------------+-------------------------------------- Comment(by nslater@…): The original reporter told me in a private communication that this behaviour is not exhibited by /bin/sh - is this not the case? -- Ticket URL: <http://trac.macports.org/ticket/17620#comment:16> MacPorts <http://www.macports.org/> Ports system for Mac OS
#17620: Problem with Installing python_select -------------------------------------+-------------------------------------- Reporter: sean.b.palmer@… | Owner: raimue@… Type: defect | Status: assigned Priority: Normal | Milestone: Port Bugs Component: ports | Version: 1.6.0 Keywords: | Port: python_select -------------------------------------+-------------------------------------- Comment(by blb@…): Note that the p5-libwww-perl port disables installing the programs, ever since it's been in the repository; looking through libwww-perl, it sounds like HEAD (and the other programs) may have been removed in favor of lwp- request at some point in the past, so a HEAD program would have come from an older libwww-perl, so having come from CPAN sounds likely. Finally, at least on 10.4 and 10.5, /bin/sh is just bash anyway, though it acts a bit differently. -- Ticket URL: <http://trac.macports.org/ticket/17620#comment:17> MacPorts <http://www.macports.org/> Ports system for Mac OS
#17620: Problem with Installing python_select -------------------------------------+-------------------------------------- Reporter: sean.b.palmer@… | Owner: raimue@… Type: defect | Status: assigned Priority: Normal | Milestone: Port Bugs Component: ports | Version: 1.6.0 Keywords: | Port: python_select -------------------------------------+-------------------------------------- Comment(by sean.b.palmer@…): Some more perplexing diagnostics: {{{ $ which head /usr/bin/head $ sh -c 'which head' /opt/local/bin/head $ bash -c 'which head' /opt/local/bin/head $ zsh -c 'which head' /opt/local/bin/head $ echo $ZSH_VERSION 4.2.3 $ zsh -c 'echo $ZSH_VERSION' 4.2.3 $ sh -l -c 'which head' /opt/local/bin/head $ zsh -l -c 'which head' /opt/local/bin/head $ env > env1 $ sh -c env > env2 $ diff =(sort env1) =(sort env2) 17c16 < SHLVL=1 ---
SHLVL=2 }}}
I'd really like to know how my regular shell can tell the difference between "HEAD" and "head" when apparently nothing else can, even though the environments (including $PATH) are the same except for shell level. -- Ticket URL: <http://trac.macports.org/ticket/17620#comment:18> MacPorts <http://www.macports.org/> Ports system for Mac OS
#17620: Problem with Installing python_select -------------------------------------+-------------------------------------- Reporter: sean.b.palmer@… | Owner: raimue@… Type: defect | Status: assigned Priority: Normal | Milestone: Port Bugs Component: ports | Version: 1.6.0 Keywords: | Port: python_select -------------------------------------+-------------------------------------- Comment(by sean.b.palmer@…): I've isolated it even further. This just gets stranger and stranger: {{{ $ zsh -c 'which head' /opt/local/bin/head $ zsh -c 'echo test; which head' test /opt/local/bin/head $ zsh -c 'date; which head' Mon Dec 15 21:05:15 GMT 2008 /usr/bin/head $ zsh -c 'which head; date; which head' /opt/local/bin/head Mon Dec 15 21:05:32 GMT 2008 /opt/local/bin/head $ bash -c 'date; which head' Mon Dec 15 21:05:55 GMT 2008 /opt/local/bin/head }}} If you do date first, it works! This seems to be a pattern with any non- shell builtin. If you do a shell builtin as the first invocation in zsh, then which doesn't work properly. If you do a non-shell builtin first, then which does work properly. -- Ticket URL: <http://trac.macports.org/ticket/17620#comment:19> MacPorts <http://www.macports.org/> Ports system for Mac OS
#17620: Problem with Installing python_select --------------------------------------+------------------------------------- Reporter: sean.b.palmer@… | Owner: raimue@… Type: defect | Status: closed Priority: Normal | Milestone: Port Bugs Component: ports | Version: 1.6.0 Resolution: wontfix | Keywords: Port: python_select | --------------------------------------+------------------------------------- Changes (by raimue@…): * status: assigned => closed * resolution: => wontfix Comment: I can only suspect this is a zsh bug. Just do not have any tools around on PATH which are supposed to be standard tools. -- Ticket URL: <http://trac.macports.org/ticket/17620#comment:20> MacPorts <http://www.macports.org/> Ports system for Mac OS
participants (1)
-
MacPorts