Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If rebuilders return more than one version for a given package, the first one is lost #4

Open
albert-astals-cid-kdab opened this issue Jan 6, 2021 · 3 comments

Comments

@albert-astals-cid-kdab
Copy link

See https://reproducible.archlinux.org/api/v0/pkgs/list?distro=archlinux at the moment, it's returning two automake versions, so when doing return {x['name']: [x['version'], x['status']] for x in req.json()} the first one is lost and it tells me that automake is not reproducible when in fact it is

@albert-astals-cid-kdab
Copy link
Author

Mega hackish solution

diff --git a/ismyarchverifiedyet.py b/ismyarchverifiedyet.py
index 326e400..380d2f4 100755
--- a/ismyarchverifiedyet.py
+++ b/ismyarchverifiedyet.py
@@ -27,7 +27,7 @@ def get_rebuilds(rebuilder):
     print(f'[*] Fetching {url}')
     req = requests.get(url)
     req.raise_for_status()
-    return {x['name']: [x['version'], x['status']] for x in req.json()}
+    return {x['name']+'@'+x['version']: x['status'] for x in req.json()}
 
 
 def get_installed_pkgs():
@@ -42,8 +42,7 @@ def main(status):
     good = 0
 
     for name, version in packages:
-        versions = [build[name] for build in rebuilds if name in build]
-        statuses = [status for ver, status in versions if ver == version]
+        statuses = [build[name+'@'+version] for build in rebuilds if name+'@'+version in build]
 
         confirmations = statuses.count('GOOD')
         good += THRESHOLD <= confirmations

but i guess there's a more pythonic way of doing that :D

@kpcyrd
Copy link
Owner

kpcyrd commented Jan 6, 2021

hey! Thanks for the bug report :) @ysf or @jelly might now what's the best solution here.

@jelly
Copy link
Contributor

jelly commented Jan 6, 2021

To make it clearer what the issue is, we have a [testing] repository which also contains automake:

[{'name': 'automake',
  'version': '1.16.2-3',
  'status': 'GOOD',
  'distro': 'archlinux',
  'suite': 'core',
  'architecture': 'any',
  'url': 'https://mirror.pkgbuild.com/core/os/x86_64/automake-1.16.2-3-any.pkg.tar.zst',
  'build_id': None,
  'built_at': None,
  'attestation': None,
  'next_retry': None},
 {'name': 'automake',
  'version': '1.16.3-1',
  'status': 'GOOD',
  'distro': 'archlinux',
  'suite': 'testing',
  'architecture': 'any',
  'url': 'https://mirror.pkgbuild.com/testing/os/x86_64/automake-1.16.3-1-any.pkg.tar.zst',
  'build_id': 4393,
  'built_at': '2020-12-03T19:13:37.531988504',
  'attestation': None,
  'next_retry': None}]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants