extract gzip files

Mark Brethen mark.brethen at gmail.com
Sun Dec 2 20:32:49 UTC 2018

Abiword used this solution:

distname AbiWord-${version}-10.2
extract.suffix .dmg.gz
extract.post_args > ${workpath}/${distname}.dmg

but I seven files, all .ps.gz, will this work with distfiles instead?

Alternatively, I could use extract {} and then change destroot to

destroot {
        xinstall -d ${destroot}${prefix}/share/doc/${name}
        foreach f ${distfiles} {
            set stem [file rootname [file tail ${f}]]
            system -W ${distpath} "gunzip -c ${f} > ${destroot}${prefix}/share/doc/${name}//${stem}"

Mark Brethen
mark.brethen at gmail.com

> On Dec 2, 2018, at 1:57 PM, Ryan Schmidt <ryandesign at macports.org> wrote:
> On Nov 30, 2018, at 08:13, Mark Brethen wrote:
>> For *.gz files (no tar), what’s the proper way to extract them to extract_dir? 
> MacPorts doesn't have specific support for this built-in, I guess because it wasn't thought to be a common enough use case. But there are several ports in the tree that do this manually; you can probably find them by grepping for "extract.suffix .gz".
> Just as we recently added a use_tar option to handle uncompressed tarballs, even though that is uncommon, we could add an option to handle gz-/bz2-/xz-/etc. compressed non-tar files. But there might be some confusion about what to call the options. We already have options use_bzip2 and use_xz, for example, which handle bz2- and xz-compressed tarballs, respectively; there is no use_gz or use_gzip, but if there were one, for consistency it would have to mean a gz-compressed tarball; there is no such option because that is the default behavior.
> Ultimately, I would like MacPorts to be able to automatically extract almost any file, without needing to be told what compression format was used. See https://lists.macports.org/pipermail/macports-dev/2016-March/032671.html . But every port that provides custom extract phase settings is an obstacle to that (i.e. is something that might break if we release a new version of MacPorts with that functionality, depending on how it's implemented), hence my desire to first provide options to accommodate most ports' extraction needs without the need to override any extract phase settings.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macports.org/pipermail/macports-dev/attachments/20181202/9624f8d6/attachment.html>

More information about the macports-dev mailing list