[arch-projects] [dbscripts] [PATCH] Don't parse .db files ourselves; use pyalpm instead

Eli Schwartz eschwartz at archlinux.org
Mon Jul 9 22:37:04 UTC 2018


On 07/09/2018 01:32 PM, Luke Shumaker wrote:
> With the "True" filter that ftpdir-cleanup and sourceballs both use,
> you're right; this could be done with expac.  But, with the context
> that this patch exists to enable me to address the concern you had
> with the other patchset:
> 
> AFAICT, with expac there's no way to do a query like:
> 
>     dbquery core x86_64 \
>     	    "(pkg.base or pkg.name) == '$pkgbase'" \
> 	    ...
> 
> Which is what most (all?) of the queries in the other patchset would
> become.
> 
> (Drat, it seems that discussing this separately from the other
> patchset won't work after all.)

Well, it's not as complex as you think. No matter what tool is used,
we'd need to manually reassemble the repository layout vs. pacman's
system DBPath. (Whether by doing database loading by hand with low-level
APIs or by providing a custom pacman.conf). But:

Checking a specific arch is as simple as using setarch first.

Current versions of makepkg set the pkgbase regardless of whether the
pkgname is different (with the rationale that there's no reason not to,
and it makes parsing package metadata easier), so we can add this to the
long list of other reasons we want to do a complete rebuild of every
package (cf. reproducible builds, PIE, and more).

And expac supports "repo/package" -- or printing the repo and filtering
that while parsing the filename or what-have-you. That being said, I've
discussed on our development IRC channel, having expac's -Ss mode to
support 'repo/.*' filtering which might be useful too...

-- 
Eli Schwartz
Bug Wrangler and Trusted User

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


More information about the arch-projects mailing list