Added support for second package condition/version argument in conver… #654
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
…tPackageVersionToTdnfArg function.
Merge Checklist
All boxes should be checked before merging the PR
Description
It was discovered that building a package with its SPEC file having two version arguments for the same depended package will result in the toolkit trying to install the latest version of the depended package.
Example (SPEC file & build command):
BuildRequires: golang < 1.25
BuildRequires: golang >= 1.24.9
This SPEC file will result in the toolkit choosing to use the latest golang package (v1.25.1)
Investigation leads to the discovery of this specific function:
convertPackageVersionToTdnfArgin this file: edge-microvisor-toolkit/toolkit/tools/internal/packagerepo/repocloner/rpmrepocloner/rpmrepocloner.go forgetting to process the second version argumentpkgVer.SCondition.The original code removes the
>=argument to avoid overheads. On top of that, it ignores the possibility of the package having a second argument, in this case,<. It was also verified that switching the first and second version argument (switching order) will result in the same outcome.Any Newly Introduced Dependencies
How Has This Been Tested?
The

convertPackageVersionToTdnfArgfunction in rpmrepocloner.go was modified to be able to process the second version argument when it's required. The same build command was used and the result now showed that the correct version of golang is used: