From: Chris Gehlker Date: 2002-01-14T12:08:58+09:00 Subject: Re: Best way for platf. independent compression? On 1/13/02 1:42 PM, "Massimiliano Mirra" wrote: > Currently, rpkg builds packets by tar'ring and gzip'ping the source > directories through GNU tar. > > However it aims to be entirely Ruby-based or at least platform > independent out of the box. If you have any though or warning on the > following subjects, I'd like to hear them: > > - is GNU tar a reasonable external requirement for this, i.e. is it > easily available on every platform that Ruby runs on or even > widespread enough that it is already installed? On Macs, gnutar will be their if the user installed the optional Developer Tools. It a pretty safe bet that she did in order to build ruby in the first place. > - do backquotes for calling external commands work reliably and > uniformly across supported platforms? In other words, will writing > `tar xcf #{pkgdir}` always do the trick or will it need tweakings > depending on the platform? Backquotes work fine but 'tar' is not symlinked to gnutar. Rather it will invoke BSD tar which, IIRC, needs an explicit z parameter to deal with .tgz files. So you are better off with `tar -xzf #{pkgdir}` Or `gnutar xcf #{pkgdir}` I think the former will work on every BSD. > - alternatively, is there any reasonable pure Ruby solution? I have > seen CompressionR, Rubyzip, and Ruby/zlib in the RAA. Could someone > who has used them a bit if not extensively suggest whether the answer > is among them? > > > Massimiliano > -- The secret of life is honesty and fair dealing. If you can fake that, you've got it made. -Groucho Marx