fix: allow fedora based packages#3479
fix: allow fedora based packages#3479AyanSinhaMahapatra merged 3 commits intoaboutcode-org:developfrom
Conversation
pombredanne
left a comment
There was a problem hiding this comment.
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
| 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.
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.
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.
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 <[email protected]>
Signed-off-by: Philip Cali <[email protected]>
| 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.
I wonder if we could get a much smaller test file for this? we only need a few packages not everything.
pombredanne
left a comment
There was a problem hiding this comment.
LGTM! Let's try to find a smaller test SQLite DB and let's merge.
|
Updated the DB! Thanks! |
Signed-off-by: Philip Cali <[email protected]>
AyanSinhaMahapatra
left a comment
There was a problem hiding this comment.
LGTM!
Thanks for the fix @philcali
Merging!
Fixes aboutcode-org/scancode.io#831
Tasks
Run tests locally to check for errors.