#4 Display our packages in
Merged 2 years ago by decathorpe. Opened 2 years ago by churchyard.
churchyard/stewardship-sig em  into  master

file modified
+5 -4
@@ -67,19 +67,19 @@ 

  

  <ul>

  {% for dependency in package.reqs %}

- <li>Required-By: {{ dependency }}</li>

+ <li>Required-By: {% if dependency in package_names %}<em>{% endif %}{{ dependency }}{% if dependency in package_names %}</em>{% endif %}</li>

  {% endfor %}

  

  {% for dependency in package.brs %}

- <li>BuildRequired-By: {{ dependency }}</li>

+ <li>BuildRequired-By: {% if dependency in package_names %}<em>{% endif %}{{ dependency }}{% if dependency in package_names %}</em>{% endif %}</li>

  {% endfor %}

  

  {% for dependency in package.recs %}

- <li>Recommended-By: {{ dependency }}</li>

+ <li>Recommended-By: {% if dependency in package_names %}<em>{% endif %}{{ dependency }}{% if dependency in package_names %}</em>{% endif %}</li>

  {% endfor %}

  

  {% for dependency in package.sugs %}

- <li>Suggested-By: {{ dependency }}</li>

+ <li>Suggested-By: {% if dependency in package_names %}<em>{% endif %}{{ dependency }}{% if dependency in package_names %}</em>{% endif %}</li>

  {% endfor %}

  </ul>

  {% endfor %}
@@ -282,6 +282,7 @@ 

          table=maintained.get_html_string(),

          leaves=leaves,

          packages=packages,

+         package_names=package_names,

      )

  

      # write output to file

So it is easier to spot them

Replace this with a jinja filter if you prefer, but it works.

Pull-Request has been merged by decathorpe

2 years ago

Still, this only marks binary packages that match the source package name.

Is there a way to query the mapping <Source package name, List<Binary package name>>?

But you should be able to get that information by creating a cached function that uses dnf repoquery ... --source <Binary package name> and calling it everytime a package appears. Let me draft something.

@functools.lru_cache(maxsize=None)
def get_source(package, run_as_root=False):
    cmd = []

    if run_as_root:
        cmd.append("sudo")

    cmd.extend(["dnf", "--quiet", "repoquery", "--repo=rawhide"])

    cmd.extend(["--source", package])

    ret = subprocess.run(cmd, stdout=subprocess.PIPE)

    ret.check_returncode()

    output: str = ret.stdout.decode()

    source = output.splitlines()[0]
    name, ev, ra = source.rsplit("-", 2)

    return name

Interesting.

I worked on this this morning, and I'm querying koji for the list of built packages from the latest successful build.

Metadata