[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#970907: marked as done (SourceRecords: Please expose release attributes)



Your message dated Fri, 2 Oct 2020 10:40:09 +0200
with message-id <97d3fe49-9b61-762f-8ba7-4018fb3d2e01@debian.org>
and subject line Re: Bug#970907: SourceRecords: Please expose release attributes
has caused the Debian Bug report #970907,
regarding SourceRecords: Please expose release attributes
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
970907: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=970907
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: python3-apt
Version: 2.1.3
Severity: wishlist

For binary packages, it's possible to determine the releases a package
is in, together with its versions, etc. Based on the example from [1]:

  (1) a package exposes "version_list"
  (2)   a version exposes "file_list"
  (3)     a file as origin, component, archive, etc. attributes.

So for a given package "foo", it's possible to differentiate between a
origin="Debian" and origin!="Debian" package, or which release for that
matter.


SourceRecords do not have this capability. They expose "files" and
"index" attributes, but it does not look like these can be used to
determine which releases these source packages are part of.

So given a source package name, it's currently not possible to determine
whether this is origin="Debian", or even which release this source is a
part of (and in particular, which version it has in that particular
release).

I would greatly appreciate it if you would consider exposing the origin,
component, archive, codename and label attributes for SourceRecords as
well.

[1] https://apt-team.pages.debian.net/python-apt/library/apt_pkg.html#example-find-all-missing-dependencies

--- End Message ---
--- Begin Message ---
On 2020-09-25 11:33, Julian Andres Klode wrote:
> They are not there in the C++ object, so they can't be exposed.
> 
> They can be exposed in MetaIndex, the MetaIndex objects you get
> from SourceList. Each MetaIndex has a list of IndexFile objects,
> and then you presumably can match them.

In the end, I found the following solution which is either related to
the above, or exactly the above and I just misunderstood you earlier:

1. SourceRecords exposes an .index attribute
2. SourceList groups indices for Sources & Packages by release
   -> for each Source index, get Package index
3. Use Package index to get the release attributes from cache.file_list

Even though it requires some hackery, this seems robust enough.

By the way, cache.file_list does not contain the Packages indices for
arch:all packages, that was surprising. I'm assuming that's intended? If
it's not, I can file a bug report.

--- End Message ---

Reply to: