Leopard's tar is broken

brian_d_foy on 2007-11-02T06:16:00

I've just upgraded my MBP to Leopard. Apple's version of tar has the annoying habit of generating extra files to represent Mac specific attributes. That's particularly annoying for CPAN authors because they tend to break your test suite and you can't easily see them without unpacking the archive on a non-Mac system. Grrr.

It used to be possible to disable this behaviour by setting the env var COPY_EXTENDED_ATTRIBUTES_DISABLE to some true value - but this seems to have stopped working in Leopard. As a result I've just released a broken version of Captcha::reCAPTCHA. Double Grrr.

strings /usr/bin/tar fails to reveal anything promising, /usr/bin/gnutar is just a hard link to /usr/bin/tar and I can't get the MacPorts gnutar to build so for now I've restored a copy of Tiger's tar from a backup and dumped it in ~/bin (which I have on my path). Phew.

Watch out Mac-based module authors - it's hard to detect that you have a broken archive without testing it on a non-Mac machine.


Ugh.

educated_foo on 2007-11-02T03:52:09

This has bitten me as well. The non-environment-variable solutions I've found are: (1) never visit perl projects in the Finder; (2) copy tarballs to a handy Unix machine to de-hose them. Neither is particularly satisfying.

Re: Leopard's tar is broken

Corion on 2007-11-02T08:21:44

Can't you inspect the .tar file using Archive::Tar? I guess that calls for a test file that checks that no resource forks have been included in a .tar file :)

Re: Leopard's tar is broken

AndyArmstrong on 2007-11-02T11:08:38

Yeah, I'm sure that would work. I was in a hurry to get a fix out :)

COPY_EXTENDED_ATTRIBUTES_DISABLE is obsoleted.

KKI on 2007-11-06T09:10:29

Use the COPYFILE_DISABLE, Luke.

----
KKI

Re:COPY_EXTENDED_ATTRIBUTES_DISABLE is obsoleted.

AndyArmstrong on 2007-11-06T12:21:49

Aha. Thanks for that :)