[pacman-dev] [PATCH 2/2] makepkg: always keep sources symlinks
cedric at gmx.ca
Wed Aug 5 10:12:44 EDT 2009
Dan McGee wrote:
> This patch just makes me cry a little bit...its like taking a
> sledgehammer to kill a fly, unfortunately. All we wanted to do was
> keep a symlink around, and we've now regressed to using extensions,
> which we haven't done since pre 3.1.0.
The extension part is only needed here because gzip/bzip2/xz rely on the correct extension. Probably I should have split the patch into two.
> $ touch test && xz test && mv test.xz test.abc && file -i test.abc && xz -d test.abc; echo $?
> `test.xz' -> `test.abc'
> test.abc: application/x-xz; charset=binary
> xz: test.abc: Filename has an unknown suffix, skipping
I see three options to address this issue:
- do not handle it at all; just throw an error and require a noextract entry
- test for the mime header AND the extension
- always decompress to stdout and write it to 'file - extension', e.g. bzip2 -dcf test.abc > test
-> this will not work if there is no extension -> throws an error; noextract entry required
Possibly, option 1 is fine as it might not be the common case that the compressed files use unsuitable extensions.
More information about the pacman-dev