tar.gz <-> tar.bz2

Neven Has haski at sezampro.yu
Thu Feb 15 07:34:23 PST 2001

> On Wed, Feb 14, 2001 at 05:56:41PM -0500, Jason Gurtz wrote:
> > The second(not so hard hopefully):  auto dealing with either gz or bz2
> > archives.  That's gota be the most annoying reason to have to go thru the
> > whole profile just to check wheather or not a package is correctly in the
> > profile as far as that goes. hehe

On Thu, Feb 15, 2001 at 02:23:40AM +0100, Neven Has wrote:
> For now, I could just add a check -- if, for example, <package>.tar.gz 
> doesn't exist, try unpacking <package>.tar.bz2. 
> But this would be only a temporary solution. Maybe the user doesn't want to 
> use the other one. 

        # Shouldn't be done by default, better as an option.
        unless (-f $archive) {
                print "No such file, trying $archive ...\n"
                        if ($archive =~ s/\.tar\.gz$/\.tar\.bz2/
                        ||  $archive =~ s/\.tar\.bz2$/\.tar\.gz/)

Very simple, but useful. 
But I'm not sure if I should commit it (see above for reason) ?


More information about the alfs-discuss mailing list