#913696 debdelta: Script accesses internal dpkg database

#913696#5
Date:
2018-11-14 03:13:55 UTC
From:
To:
Hi!

This package contains a script («debdelta»), which directly accesses
the dpkg internal database, instead of using one of the public interfaces
provided by dpkg. The code in do_patch_, should be switched to use:

  «dpkg-query --showformat='${Conffiles}\n' --show»

to fetch the list of conffiles. Then _symlink_data_tree should be switched
to always use dpkg_L, and dpkg_L_faster should be removed. Finally the
code handling 'old-control-tree' should be switched to use something like:

  «dpkg-query --control-list»


This is a problem for several reasons, because even though the layout and
format of the dpkg database is administrator friendly, and it is expected
that those might need to mess with it, in case of emergency, this
“interface” does not extend to other programs besides the dpkg suite of
tools. The admindir can also be configured differently at dpkg build or
run-time. And finally, the contents and its format, will be changing in
the near future.

Thanks,
Guillem

#913696#10
Date:
2019-02-02 09:59:05 UTC
From:
To:
Dear Guillem,

I see your point;

but (as the name " dpkg_L_faster" suggests), using the dpkg commands to
obtain meta-information is quite slow; so I will have to think about it

BTW: you write
May you please point me to some more info regarding this change?

Thanks,

a.

Il 14/11/18 04:13, Guillem Jover ha scritto:

#913696#15
Date:
2021-06-17 02:07:48 UTC
From:
To:
Hi!

[ Sorry, it seems I missed replying to this. ]

Ok, the dpkg_L function can be improved substantially by querying
multiple packages at once, batched up to the ARG_MAX command-line
limit. This should improve the query substantially up to or even
faster times than the current code.

If you need the entire files database, you could instead do something
like:

  ,---
  dpkg-query \
    --showformat='Package: ${Package}\nFiles:\n${db-fsys:Files}\n' \
    --show
  `---

This would be <https://wiki.debian.org/Teams/Dpkg/Spec/MetadataTracking>.

Thanks,
Guillem