Uniquely identify the Resolvable object to avoid random failures
Details
The Resolvable class uses the kind, name, version, arch and source attributes for mapping the Ruby objects to the libzypp objects. (It avoids using memory pointers or other "unsafe" options.) It assumed that a repository cannot contain the same package in exactly same version twice (or more than once).
But it turned out that this is not true for Product objects, the updates repository can contain several sles-release RPM packages defining the very same SLES-15.2-0 product:
The problem is when the code asks: "Is the SLES-15.2-0 product selected to install?" At that point the code will evaluate the status of the first found object. If accidentally the second object is selected to install the YaST will see unselected SLES and report that "No base product selected" error.
The Solution
That means we need to add another attribute which is unique. And that's the path (location) in the repo on the medium (example: ./x86_64/yast2-4.1.77-lp151.2.19.1.rpm). Zypp Product does not have a package path, but we can use it's reference package (usually the *-release.rpm).
I have removed the GPG signature from the test_repo testing repository. The used GPG key expired, libzypp could possibly reject it. Now the repository is unsigned, just like the new testing repository with the SLES products.
Coverage increased (+0.002%) to 31.095% when pulling 739183c9debdf79af9ea278f09ad953d19a42d93 on bsc_1178688_sp2 into 183cdeb5e51c754f930a10b9e3d7aaaa930741bd on SLE-15-SP2.
Details
The
Resolvable
class uses thekind
,name
,version
,arch
andsource
attributes for mapping the Ruby objects to the libzypp objects. (It avoids using memory pointers or other "unsafe" options.) It assumed that a repository cannot contain the same package in exactly same version twice (or more than once).But it turned out that this is not true for Product objects, the updates repository can contain several
sles-release
RPM packages defining the very sameSLES-15.2-0
product:The problem is when the code asks: "Is the SLES-15.2-0 product selected to install?" At that point the code will evaluate the status of the first found object. If accidentally the second object is selected to install the YaST will see unselected SLES and report that "No base product selected" error.
The Solution
That means we need to add another attribute which is unique. And that's the path (location) in the repo on the medium (example:
./x86_64/yast2-4.1.77-lp151.2.19.1.rpm
). ZyppProduct
does not have a package path, but we can use it's reference package (usually the*-release.rpm
).Dependencies
Testing
irb
sessionAdditional Changes
test_repo
testing repository. The used GPG key expired, libzypp could possibly reject it. Now the repository is unsigned, just like the new testing repository with the SLES products.