Skip to content

Conversation

@Jayant-kernel
Copy link

@Jayant-kernel Jayant-kernel commented Jan 17, 2026

Problem

RPM packages were showing incomplete version strings. The release field was being dropped, causing versions like 4.4.20-4.el8_6 to appear as just 4.4.20.

Solution

Modified rpm_installed.py to capture and combine the version and release fields using the same logic as EVR.to_string() in rpm.py.

Changes

  • Added handlers for Epoch and Release RPM tags
  • Implemented inline version-release-epoch combining logic to avoid circular imports
  • Updated 9 test expected files to reflect full version strings

Testing

  • All 85 RPM tests passing (76 in test_rpm.py + 9 in test_rpm_installed.py)
  • No circular imports introduced
  • Edge cases verified (missing release, epoch handling)

Example

Before: pkg:rpm/bash@4.4.20?arch=x86_64
After: pkg:rpm/bash@4.4.20-4.el8_6?arch=x86_64

Fixes #4684

Tasks

Reviewed contribution guidelines
PR is descriptively titled and links the original issue above
Tests pass -- look for a green checkbox (All 85 RPM tests passing locally)
Commits are in uniquely-named feature branch and has no merge conflicts
Updated documentation pages (not applicable - internal implementation change)
Updated CHANGELOG.rst (not applicable - bug fix, maintainers will update)

Modified rpm_installed.py to combine version and release fields:
- Added handlers for Epoch and Release tags
- Implemented version-release-epoch combining logic inline
- Matches EVR.to_string() behavior from rpm.py
- Updated 9 test expected files with full version strings

All 85 RPM tests passing. No circular imports introduced.

Fixes aboutcode-org#4684

Signed-off-by: NullPointer-cell <jayantmcom@gamil.com>
@Jayant-kernel
Copy link
Author

@pombredanne sir
I would like you to review my pr and I would be happy to any recommendation on changes

@Jayant-kernel
Copy link
Author

Closing this PR to simplify the approach based on best practices.

The current PR updates 9 files (~13,685 lines) which makes review challenging. I'm going to:

  1. Create a minimal PR with just the code fix + 1 regression test (~50 lines)
  2. Follow up later with test data updates in a separate PR

This makes review easier and gets the fix merged faster. Will reference this PR in the new one.

Thanks for your patience! 🙏

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.

RPMs version is truncated in container image scan

1 participant