This works, avoids overriding extract, but is less direct:

    extract.cmd             cp
    extract.pre_args
    extract.post_args   ${workpath}/.

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

Preference?


Mark Brethen
[email protected]



> On Dec 2, 2018, at 2:32 PM, Mark Brethen <[email protected]> wrote:
> 
> 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
> [email protected] <mailto:[email protected]>
> 
> 
> 
>> On Dec 2, 2018, at 1:57 PM, Ryan Schmidt <[email protected] 
>> <mailto:[email protected]>> 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 
>> <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.
>> 
> 

Reply via email to