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

Luke Shumaker lukeshu at lukeshu.com
Tue Jul 10 00:33:45 UTC 2018


On Mon, 09 Jul 2018 18:37:04 -0400,
Eli Schwartz wrote:
> On 07/09/2018 01:32 PM, Luke Shumaker wrote:
> > AFAICT, with expac there's no way to do a query like:
> > 
> >     dbquery core x86_64 \
> >         "(pkg.base or pkg.name) == '$pkgbase'" \
> >         ...
> 
> 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.

The part I'm concerned about is being able to do is filtering by
pkgbase rather than pkgname; setting up repository layout is simple
enough either way (it just comes down to setting DBpath (and RootDir?)
to a temporary directory and setting
`$repo.Server=file://$FTP_BASE/$repo/os/$arch`).

> 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).

Ok, but even if/when all packages have pkgbase, expac still doesn't
have the ability to search based on pkgbase instead of pkgname, does
it?

> 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...

I guess we could have it print all packages for the repo, include
pkgbase in the output, then filter that with grep...

-- 
Happy hacking,
~ Luke Shumaker


More information about the arch-projects mailing list