-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix detection of gcc-c++ and other package names. #374
Conversation
The regular expression that was being used to parse package names out of yum output was missing gcc-c++, NetworkManager, and other package names. Using a simpler regex and a function that parses the package names from the rest of the NVR should fix that. This fixes a user visible problem where packages like gcc-c++ can cause convert2rhel to fail to downgrade packages. This is because gcc-c++ would be missed by the regex and thus we'd be unable to figure out that we need to downgrade gcc-c++ when downgrading gcc.
Co-authored-by: Eric Gustavsson <[email protected]>
521333a
to
7881948
Compare
Updated to use @SpyTec 's regex and added some simple unittests for the new function. Probably should add to the unittests for |
The unit test can test with:
|
* test_find_pkg_names: Add a few more package names that represent cornercases ("." in package name, starts with a digit, has version numbers in the name, has uppercase characters, has an epoch. * test_get_problematic_pkgs: Move this out of the unittest.TestCase so that we can use pytest's parametrize functionality with it. * Rework the test to use parametrize. Parametrize will run a separate test for each set of assertions, that way we will (1) be able to pinpoint which data caused the problem and (2) will test all of the permutations of calling get_problematic_pkgs instead of failing on the first problem and not knowing whether the other datasets passed. * Found that the Requires dataset should be causing a test failure. Break that into a separate test function that tests a subset of functionality for now with comments on what is going wrong. Opened Issue oamg#378 to address that in the future.
Added those packages to the unittest for |
/packit build |
* Add pkg names with dots, dashes, starting with numbers, plus signs and uppercase to our tests of get_problematic_pkgs(). All of these filenames now are properly parsed for Error tests (which is what this PR focuses on fixing) but do not work when specified in a Requires. That should be addressed when oamg#378 is fixed. * Added the java-1.8.0-openjdk package to the unusual package names to check (version number with dots embedded inside of the package name)
Okay, unless CI finds some new problems, I'm done with this PR now. The latest commit just adds to the unittests. One interesting note is that all of the package names @bocekm mentioned here: #374 (comment) now succeed when parsed from the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested manually on OL7 with gcc-c++ installed:
Found packages causing dependency errors: set([u'nss-softokn', u'gcc', u'gcc-c++', u'libstdc++-devel'])
@kokesak verified the change as well. |
Fix detection of gcc-c++ and other package names. The regular expression that was being used to parse package names out of yum output was missing gcc-c++, NetworkManager, and other package names. Using a simpler regex and a function that parses the package names from the rest of the NVR should fix that. This fixes a user visible problem where packages like gcc-c++ can cause convert2rhel to fail to downgrade packages. This is because gcc-c++ would be missed by the regex and thus we'd be unable to figure out that we need to downgrade gcc-c++ when downgrading gcc. * test_find_pkg_names: Add a few more package names that represent cornercases ("." in package name, starts with a digit, has version numbers in the name, has uppercase characters, has an epoch). * Found that the Requires dataset should be causing a test failure. Break that into a separate test function that tests a subset of functionality for now with comments on what is going wrong. Opened Issue oamg#378 to address that in the future. * Add pkg names with dots, dashes, starting with numbers, plus signs and uppercase to our tests of get_problematic_pkgs(). All of these filenames now are properly parsed for Error tests (which is what this PR focuses on fixing) but do not work when specified in a Requires. That should be addressed when oamg#378 is fixed. * Added the java-1.8.0-openjdk package to the unusual package names to check (version number with dots embedded inside of the package name) Co-authored-by: Eric Gustavsson <[email protected]> Co-authored-by: Michal Bocek <[email protected]>
The regular expression that was being used to parse package names out of
yum output was missing gcc-c++, NetworkManager, and other package names.
Using a simpler regex and a function that parses the package names from
the rest of the NVR should fix that.
This fixes a user visible problem where packages like gcc-c++ can cause
convert2rhel to fail to downgrade packages. This is because gcc-c++
would be missed by the regex and thus we'd be unable to figure out that
we need to downgrade gcc-c++ when at the same time as we downgrade gcc.
Resolves OAMG-6136.