On Dec 9, 2007, at 16:05, Tom McDonough wrote:

[snip]
There's one other result for this error message on Google now, from
just a week and a half ago:

http://www.ghostwheel.com/merlin/Personal/notes/2007/11/28/os-x-unix-
and-dont-you-forget-it/

It suggests that fontconfig's build process is trying to run the
"head" command (used for getting the first few lines of something)
but is instead finding the "HEAD" command (part of libwww-perl, which
retrieves the headers of a web page). Since the Mac's HFS+ filesystem
is case-insensitive, it treats these different scripts the same. Have
you installed libwww-perl through MacPorts (port name: p5-libwww-
perl), or perhaps manually e.g. using CPAN? Use "which head" to see
which head program is being used, and then prod it for some more
information. On my system, "which head" produces "/usr/bin/head" and
"file /usr/bin/head" says this:

/usr/bin/head: Mach-O universal binary with 2 architectures
/usr/bin/head (for architecture i386): Mach-O executable i386
/usr/bin/head (for architecture ppc): Mach-O executable ppc

This is what I expected: it's a universal binary, as it should be on
an Intel Mac. (If you have a PowerPC Mac, it should just be a ppc
executable.) If however it is reported to be a text file, then you
have a problem:

- If "which head" says it's in /usr/bin and it's a text file, then
you have the problem that you have manually installed libwww-perl and
it has overwritten your system's "head" command with its own "HEAD"
script, and you will need to restore the OS's "head" command from
your system DVD. I remember this very thing happening to me in the
early days of Mac OS X, back when I was still using Perl. :-)
[snip]

% file /usr/bin/head
/usr/bin/head: perl script text executable

So that means you have (perhaps inadvertently) installed libwww-perl, a.k.a. LWP, perhaps using CPAN, perhaps as a dependency of some other software you installed using CPAN, and it has overwritten your system's "head" command (which is a vital utility) with an unrelated and probably seldom-used perl script called "HEAD". I believe during CPAN installation of libwww-perl, it asks if you would like to have "HEAD" and other similar utility programs. I remember being completely overwhelmed with all the questions CPAN would ask during many of its installations, to the point that I would just answer each question with the default (without really understanding them) until the questions went away. Perhaps installation of these utility scripts is the default, which would be bad on Mac OS X's case- insensitive HFS+, as you can see.

However, I got my perl directly from the Apple install disk. Never fooled around with it myself, unless the installation of some other software changed it. Anyway, I can't live without perl. Are you suggesting downloading perl from MacPorts as the best alternative?


You don't need to live without perl, you just need to live without the "HEAD" script installed by the libwww-perl module, or if you do need it, move it out of /usr/bin or rename it so that it does not conflict with the system's "head" program. And be careful if you ever need to upgrade libwww-perl that it doesn't go and overwrite "head" again.

I have p5-libwww-perl installed through MacPorts (not sure why, must be a dependency of something) and according to "port contents" it does not include the HEAD script. So installing libwww-perl and whatever other perl modules you need via MacPorts might be a safer alternative to CPAN.

You can fix this problem now by inserting your Mac OS X DVD and copying the correct "head" command from its /usr/bin to your hard drive's /usr/bin. You may also want to copy over a backup copy (say, / usr/bin/head-saved) in case you find yourself in this situation again in the future and perhaps don't have your Mac OS X DVD handy.

_______________________________________________
macports-users mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo/macports-users

Reply via email to