-
-
Notifications
You must be signed in to change notification settings - Fork 562
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: allow fedora based packages #3479
Conversation
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.
Thanks! This is exactly what is needed! ❤️
Do you mind adding your DCO signoff?
Also we need some tests to avoid a regression.
It does not have to be a full end-to-end test as it would be enough to "recognize" an A SQLite db ... may something like one of these tests? https://github.com/nexB/scancode-toolkit/blob/develop/tests/packagedcode/test_recognize.py that could use a super small rpmdb (eventually trimmed down to get only one or two RPMs)
Another test we would need is an end-to-end test from the CLI using the --system-package option,
src/packagedcode/rpm.py
Outdated
@@ -231,8 +231,7 @@ class RpmInstalledNdbDatabaseHandler(BaseRpmInstalledDatabaseHandler): | |||
class RpmInstalledSqliteDatabaseHandler(BaseRpmInstalledDatabaseHandler): | |||
# used by newer RHEL/CentOS/Fedora | |||
datasource_id = 'rpm_installed_database_sqlite' | |||
path_patterns = ('*var/lib/rpm/rpmdb.sqlite',) | |||
filetypes = ('berkeley',) | |||
path_patterns = ('*var/lib/rpm/rpmdb.sqlite', '*usr/lib/sysimage/rpm/rpmdb.sqlite',) |
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.
We could also relax it even more like in:
path_patterns = ('*var/lib/rpm/rpmdb.sqlite', '*usr/lib/sysimage/rpm/rpmdb.sqlite',) | |
path_patterns = ('*rpm/rpmdb.sqlite',) |
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.
I like that. I'll make the change. Also. I have a pending change to support rpm-ostree variants too.
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.
Thanks!
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.
I created a unit test, but I noted that unrelated tests seem to fail (unsure about those). Also, I was not sure about the --system-package
testing. Happy to author, but would need a pointer to the starting thread.
Signed-off-by: Philip Cali <philip.cali@gmail.com>
Signed-off-by: Philip Cali <philip.cali@gmail.com>
@@ -196,3 +196,9 @@ def test_recognize_go_sum(self): | |||
packages = recognize_package_data(test_file) | |||
assert packages | |||
assert isinstance(packages[0], models.PackageData) | |||
|
|||
def test_recognize_rpmdb_sqlite(self): | |||
test_file = self.get_test_loc('rpm/rpmdb.sqlite') |
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.
I wonder if we could get a much smaller test file for this? we only need a few packages not everything.
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.
LGTM! Let's try to find a smaller test SQLite DB and let's merge.
Updated the DB! Thanks! |
Signed-off-by: Philip Cali <philip.cali@gmail.com>
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.
LGTM!
Thanks for the fix @philcali
Merging!
Fixes aboutcode-org/scancode.io#831
Tasks
Run tests locally to check for errors.