Bug#920024: Doesn't parse package architectures correctly when any-amd64 is used (etc.)

2022-09-13 Thread Johannes Schauer Marin Rodrigues
Quoting Johannes Schauer (2019-03-27 06:05:51)
> On Tue, 22 Jan 2019 00:44:03 +0100 Raphael Hertzog  wrote:
> > On Mon, 21 Jan 2019, Steve McIntyre wrote:
> > > I've just been looking at the details for sbsigntool
> > > (https://tracker.debian.org/pkg/sbsigntool) It looks like the tracker
> > > code is confused by the architecture list for sbsigntool:
> > > 
> > >   Architecture: any-amd64 any-i386 arm64 armhf
> > > 
> > > and is just showing 
> > > 
> > >   arch: arm64 armhf
> > > 
> > > which is quite confusing!
> > 
> > Yeah, the data model includes a list of architectures by source package
> > and the parsing keeps only entries which are real architectures, the
> > architecture wildcards are just not handled.
> > 
> > Extract from distro_tracker/core/retrieve_data.py:
> > 
> > # Convert the parsed data into corresponding model instances
> > if 'architectures' in entry:
> > # Map the list of architecture names to their objects
> > # Discards any unknown architectures.
> > entry['architectures'] = Architecture.objects.filter(
> > name__in=entry['architectures'])
> > 
> > I think we don't have any code in the tracker to handle architecture 
> > wildcard
> > and try to do any mapping or expansion. Given the data model, that's we 
> > should
> > aim to do here. Creating all the possible wildcards would be wrong, instead 
> > we
> > want to process the list of architectures that the tracker knows of and see
> > whether it matches the wildcards listed in the source package field.
> 
> Feel free to use this Debian architecture wildcard matching implementation:
> 
> https://gitlab.mister-muffin.de/josch/debarchwildcardtest/blob/master/debarch.py
> 
> In my opinion this code should really live in python-debian but hasn't been
> put there yet (#771058).

starting with python3-debian 0.1.45 you can do this:

from debian.debian_support import DpkgArchTable
arch_table = DpkgArchTable.load_arch_table()
print(arch_table.matches_architecture("amd64", "linux-any"))

if tracker is running on stable, then maybe this bug can be fixed after the
bookworm release?

Thanks!

cheers, josch

signature.asc
Description: signature


Bug#920024: Doesn't parse package architectures correctly when any-amd64 is used (etc.)

2019-03-26 Thread Johannes Schauer
On Tue, 22 Jan 2019 00:44:03 +0100 Raphael Hertzog  wrote:
> On Mon, 21 Jan 2019, Steve McIntyre wrote:
> > I've just been looking at the details for sbsigntool
> > (https://tracker.debian.org/pkg/sbsigntool) It looks like the tracker
> > code is confused by the architecture list for sbsigntool:
> > 
> >   Architecture: any-amd64 any-i386 arm64 armhf
> > 
> > and is just showing 
> > 
> >   arch: arm64 armhf
> > 
> > which is quite confusing!
> 
> Yeah, the data model includes a list of architectures by source package
> and the parsing keeps only entries which are real architectures, the
> architecture wildcards are just not handled.
> 
> Extract from distro_tracker/core/retrieve_data.py:
> 
> # Convert the parsed data into corresponding model instances
> if 'architectures' in entry:
> # Map the list of architecture names to their objects
> # Discards any unknown architectures.
> entry['architectures'] = Architecture.objects.filter(
> name__in=entry['architectures'])
> 
> I think we don't have any code in the tracker to handle architecture wildcard
> and try to do any mapping or expansion. Given the data model, that's we should
> aim to do here. Creating all the possible wildcards would be wrong, instead we
> want to process the list of architectures that the tracker knows of and see
> whether it matches the wildcards listed in the source package field.

Feel free to use this Debian architecture wildcard matching implementation:

https://gitlab.mister-muffin.de/josch/debarchwildcardtest/blob/master/debarch.py

In my opinion this code should really live in python-debian but hasn't been put
there yet (#771058).

Thanks!

cheers, josch


signature.asc
Description: signature


Bug#920024: Doesn't parse package architectures correctly when any-amd64 is used (etc.)

2019-01-21 Thread Raphael Hertzog
On Mon, 21 Jan 2019, Steve McIntyre wrote:
> I've just been looking at the details for sbsigntool
> (https://tracker.debian.org/pkg/sbsigntool) It looks like the tracker
> code is confused by the architecture list for sbsigntool:
> 
>   Architecture: any-amd64 any-i386 arm64 armhf
> 
> and is just showing 
> 
>   arch: arm64 armhf
> 
> which is quite confusing!

Yeah, the data model includes a list of architectures by source package
and the parsing keeps only entries which are real architectures, the
architecture wildcards are just not handled.

Extract from distro_tracker/core/retrieve_data.py:

# Convert the parsed data into corresponding model instances
if 'architectures' in entry:
# Map the list of architecture names to their objects
# Discards any unknown architectures.
entry['architectures'] = Architecture.objects.filter(
name__in=entry['architectures'])

I think we don't have any code in the tracker to handle architecture wildcard
and try to do any mapping or expansion. Given the data model, that's we should
aim to do here. Creating all the possible wildcards would be wrong, instead we
want to process the list of architectures that the tracker knows of and see
whether it matches the wildcards listed in the source package field.

Cheers,
-- 
Raphaël Hertzog ◈ Debian Developer

Support Debian LTS: https://www.freexian.com/services/debian-lts.html
Learn to master Debian: https://debian-handbook.info/get/



Bug#920024: Doesn't parse package architectures correctly when any-amd64 is used (etc.)

2019-01-21 Thread Steve McIntyre
Package: tracker.debian.org
Severity: normal

Hi folks,

Thanks for the great service on tracker. It really makes my life
easier when doing Debian work!

I've just been looking at the details for sbsigntool
(https://tracker.debian.org/pkg/sbsigntool) It looks like the tracker
code is confused by the architecture list for sbsigntool:

  Architecture: any-amd64 any-i386 arm64 armhf

and is just showing 

  arch: arm64 armhf

which is quite confusing!

-- System Information:
Debian Release: 9.6
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable-debug'), (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.9.0-8-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)