Skip to content

fix: correct RPM package name/version regex split (closes #199)#309

Draft
vmuralictr wants to merge 2 commits into
openmainframeproject:masterfrom
vmuralictr:fix/rpm-package-regex-issue-199
Draft

fix: correct RPM package name/version regex split (closes #199)#309
vmuralictr wants to merge 2 commits into
openmainframeproject:masterfrom
vmuralictr:fix/rpm-package-regex-issue-199

Conversation

@vmuralictr

Copy link
Copy Markdown
Collaborator

Fix RPM package parsing in bin/package_build.py so package names and versions are split correctly for Fedora-style package filenames.

@vmuralictr vmuralictr force-pushed the fix/rpm-package-regex-issue-199 branch from 89dafa6 to 4653305 Compare June 29, 2026 13:35
@vmuralictr vmuralictr marked this pull request as draft June 29, 2026 13:44
…oject#199)

Replaces the fragile regex split with a proper RPM filename parser
based on the approach from PR openmainframeproject#201 by @hbarsaiyan.

RPM filenames follow the format: name-version-release.dist.arch
The original regex split at the first hyphen before a digit, which
broke multi-part names like tzdata-java-2023c-1.fc42.s390x.

The new parse_rpm_filename() helper uses rfind to locate the arch,
release, and version boundaries from the right, correctly producing:
  tzdata-java-2023c-1.fc42.s390x -> name=tzdata-java, version=2023c-1

Applied to clefos(), fedora(), almaLinux(), and rockylinux().
Also switches from open()/close() to context managers (with open()).
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

Successfully merging this pull request may close these issues.

1 participant