Skip to content

Improve package-name extraction in base-images/cpu/c9s-python-3.12/README.md helper script #2693

@coderabbitai

Description

@coderabbitai

Context

In PR #2690, a helper script was added to generate the list of additional packages by comparing SCL and AIPCC package lists. The current implementation uses rsplit('-', 2)[0] to strip version information, which can be inaccurate for package names containing dashes.

Current Approach

line.strip().rsplit('-', 2)[0]

This can leave version-like suffixes when package names contain dashes (e.g., httpd-core-2.4.0-... becomes httpd-core-2.4.0).

Suggested Improvement

Use RPM's query format to get pure package names directly:

podman run --rm --pull=always quay.io/sclorg/python-312-c9s:c9s rpm -qa --qf '%{NAME}\n' | sort > /tmp/scl_packages.txt
podman run --rm --pull=always quay.io/aipcc/base-images/cpu:3.1 rpm -qa --qf '%{NAME}\n' | sort > /tmp/aipcc_packages.txt

And simplify the Python helper to read raw names without rsplit.

Benefits

  • Package diffs will be based purely on package presence, independent of version components
  • More reliable and maintainable approach
  • Future updates will be cleaner

References

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

📋 Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions