[pacman-dev] [PATCH] [Idea] makepkg: Extract from any file bsdtar can recognize
git at nezmer.info
Sat May 29 17:44:51 EDT 2010
On Sat, May 29, 2010 at 04:17:16PM -0500, Dan McGee wrote:
> On Sat, May 29, 2010 at 4:08 PM, Andres P <aepd87 at gmail.com> wrote:
> > On Sat, May 29, 2010 at 03:44:07PM -0400, Nezmer wrote:
> >> If "file -bizL" does not return a supported type. Check if the dist file
> >> is recognized by bsdtar and if yes extract from it.
> > This is great, but I think this check:
> >> ?? if bsdtar -tf "$file" &>/dev/null; then
> > Should come before:
> >> ?? local file_type=$(file -bizL "$file")
> > If bsdtar -tf is deemed as reliable, then it should make the file(1)
> > check redundant, seeing that makepkg uses bsdtar to extract.
> Except you've now introduced the overhead of reading every archive
> twice which is really stupid, since 95% of files will pass the "file"
> It would be much more beneficial if someone could see if upstream
> bsdtar could add some command line flag to basically check if a file
> is a valid archive that bsdtar can process and gives a return code
> based off of that (without having to read through the entire archive).
Unfortunately, "bsdtar -tqf" always returns 0 here. If I understand the
man page correctly, this should not be the case as optimization should
not bypass errors.
The idea is a compromise after all.
Is the automation of extraction from valid archives worth the overhead or not?
More information about the pacman-dev