extract tar.bz2 and tar.gz

Bradley Giesbrecht pixilla at macports.org
Thu Apr 28 10:28:31 PDT 2011


On Apr 28, 2011, at 9:34 AM, Ryan Schmidt wrote:

> 
> On Apr 28, 2011, at 11:31, Ryan Schmidt wrote:
> 
>> On Apr 28, 2011, at 11:24, Bradley Giesbrecht wrote:
>> 
>>> Fetching src with .tar.bz2 suffix and patch with .tar.gz suffix.
>>> 
>>> Do I need to add a custom extract {} stage to my Portfile?
>>> 
>>> Or is there some use_bzip2:${filename} type mechanism?
>> 
>> I don't believe you need to do anything special. Put "use_bzip2 yes", list your bz2 distfile's name in distname if necessary, and list your patchfiles' names in the patchfiles line; any mixture of uncompressed, gzip-compressed, or bzip2-compressed patchfiles should be fine and MacPorts will handle each of them based on their extension. At least that's how I read the code:
>> 
>> https://trac.macports.org/browser/trunk/base/src/port1.0/portpatch.tcl?rev=78062#L98
> 
> 
> Hmm, what I wrote applies to patchfiles -- compressed or uncompressed text files. But you said your patch is a .tar.gz. If that's true, then indeed you'll need something custom. I wouldn't override the extract phase; I'd let MacPorts extract the main distfile as per usual. List the main distfile name in "extract.only" so MacPorts doesn't try to extract the other file. Then write a post-extract block to manually extract the extra .tar.gz file.

Right, I've done this before. Cool, and thanks.

There are a number of "patch files" rolled into a tar.gz so I don't know how I would list them in patchfiles.

I'll unpack the patches in post-extract and apply the patches in pre-patch, in case I need to add my own patches.



Regards,
Bradley Giesbrecht (pixilla)






More information about the macports-dev mailing list