[arch-projects] [namcap] [PATCH] Add handling for compression into namcap.py

Eli Schwartz eschwartz at archlinux.org
Fri Dec 11 20:29:10 UTC 2020


On 12/11/20 2:25 PM, meganomic via arch-projects wrote:
> Adds handling of the compression and temporary storage into namcap.py
> so it can be removed from the bash script.
> https://bugs.archlinux.org/task/59844 mentions "use setuptools entry
> points." instead of the bash script but I don't know how to do that.
> I just removed it from the bash script for now.

The subprocess to decompression tools is still (with your patch) just as 
annoying to me as the existence of the bash script. Python's builtin 
tarfile.open can handle gz, bz2, or xz. Using the python-xtarfile module 
you can use xtarfile.open to also handle zst. We should prefer the 
native code instead of basically inlining bash into python.

True, in order to support lzo, lrz, lz4, lz, we might still need to do 
subprocess out and create a temporary file with the decompressed 
package, but this should really be a last resort (and users in practice 
should rarely hit this code).

What do you think about trying xtarfile first?

-- 
Eli Schwartz
Bug Wrangler and Trusted User

-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.archlinux.org/pipermail/arch-projects/attachments/20201211/ed12a475/attachment.sig>


More information about the arch-projects mailing list