tar version comparison

Darren Weber dweber at macports.org
Thu Jul 2 12:23:34 PDT 2009


On Wed, Jul 1, 2009 at 3:57 PM, Joshua Root <jmr at macports.org> wrote:

> On 2009-7-2 07:16, Darren Weber wrote:
> >
> > I need to test if the system has a tar version between 1.14 and 1.14.90,
> > what is the best way to do this in tcl?
>
> Toby has answered your question, but it seems like you'd be better off
> just depending on gnutar rather than messing around doing different
> things for different tar versions.
>
> - Josh
>

Can we assume that a dependency on gnutar will provide either
${prefix}/bin/gnutar or ${prefix}/bin/tar?

To check for gnutar or tar, maybe the following could be used:

if [file exists ${prefix}/bin/gnutar] {
  set gnutar ${prefix}/bin/gnutar
} elseif [file exists ${prefix}/bin/tar] {
  set gnutar ${prefix}/bin/tar
}
# maybe some kind of confirmation that we get gnutar?
# exec $gnutar --version

To set this variable globally for a Portfile, where is the best place to put
it?  Assume the dependency on gnutar requires an installation.

TIA,
Darren
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-dev/attachments/20090702/59503423/attachment.html>


More information about the macports-dev mailing list