extract tar.bz2 and tar.gz

Ryan Schmidt ryandesign at macports.org
Thu Apr 28 09:34:40 PDT 2011


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.




More information about the macports-dev mailing list