[pacman-dev] [PATCH 1/3] libmakepkg: use extraction commands instead of file to find archive type

Allan McRae allan at archlinux.org
Mon Dec 2 04:08:44 UTC 2019


On 27/11/19 7:29 am, Ethan Sommer wrote:
> Previously, to determine which command we should use to extract an
> archive, we would run file and match the output against our list of
> possible extraction commands
> 
> Instead, run the archive through each extraction command's -t (--test)
> flag, if this succeeds then we know that the command is able to extract
> the file and is the one to use
> 


Apart from the issues Eli brought up, there is a large performance
regression on large source files.


$ time file -bizL libreoffice-6.3.4.1.tar.xz
application/x-tar; charset=binary compressed-encoding=application/x-xz;
charset=binary

real	0m0.034s
user	0m0.031s
sys	0m0.004s


$ time xz -t libreoffice-6.3.4.1.tar.xz

real	0m11.970s
user	0m11.898s
sys	0m0.057s


Allan


More information about the pacman-dev mailing list