[pacman-dev] [PATCH] makepkg: Fix xz extraction

Cedric Staniewski cedric at gmx.ca
Wed Aug 5 06:51:55 EDT 2009

Xavier wrote:
> On Tue, Aug 4, 2009 at 11:51 PM, Cedric Staniewski<cedric at gmx.ca> wrote:
>> Unfortunately, gzip/gunzip do not have something like a -k option and it
>> seems that there are no plans to add one [1,2]. The only possibilities
>> are recreating the link or decompressing to stdout (gzip -dc file.gz >
>> file).
>> By the way, another issue might be the use of file, because
>> decompressing via gzip/bzip2/xz without the -c option relies on the suffix.
>> [1] http://www.mail-archive.com/bug-gzip@gnu.org/msg00039.html
>> [2] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=240539
> yeah, I realized after writing my mail that gzip didn't have -k. crazy..
> I wanted to go the lazy way and only fix bzip2 and xz, and not worry
> about gzip for now.
> About file type vs file extension : I don't see what we could do if
> the file extension is wrong. It is not possible to compute a
> destination file, so we can only fail there. And this is what should
> happen currently.
> However, if we want to fix the issue with gzip -dc file.gz > file , we
> probably need to check the extension, before trying to strip it.
> And if the extension does not match, we would probably fail here too.
> _______________________________________________
> pacman-dev mailing list
> pacman-dev at archlinux.org
> http://www.archlinux.org/mailman/listinfo/pacman-dev

I would prefer skipping files with unsuitable extensions rather than
failing and forcing to add these files to noextract.

A fairly robust patch (gzip suffixes -gz, -z, _z are not supported
though) can be found in the following mails. It is based on master, not
on the first patch of this thread.

More information about the pacman-dev mailing list