Skip to content

Commit f2bdc30

Browse files
Add namespace from distro-id
Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
1 parent fb481be commit f2bdc30

File tree

3 files changed

+19
-15
lines changed

3 files changed

+19
-15
lines changed

scanpipe/pipes/rootfs.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,8 @@ def scan_rootfs_for_system_packages(project, rootfs):
265265
installed_packages = rootfs.get_installed_packages(package_getter)
266266
for index, (purl, package) in enumerate(installed_packages):
267267
logger.info(f"Creating package #{index}: {purl}")
268+
if package.namespace != distro_id:
269+
package.namespace = distro_id
268270
_create_system_package(project, purl, package)
269271

270272

81 Bytes
Binary file not shown.

scanpipe/tests/data/basic-rootfs_root_filesystems.json

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -31,24 +31,26 @@
3131
"distro": {
3232
"os": "linux",
3333
"architecture": null,
34-
"name": "Debian GNU/Linux",
35-
"version": "9 (stretch)",
36-
"identifier": "debian",
37-
"id_like": null,
38-
"version_codename": null,
39-
"version_id": "9",
40-
"pretty_name": "Debian GNU/Linux 9 (stretch)",
34+
"name": "Ubuntu",
35+
"version": "22.04.3 LTS (Jammy Jellyfish)",
36+
"identifier": "ubuntu",
37+
"id_like": "debian",
38+
"version_codename": "jammy",
39+
"version_id": "22.04",
40+
"pretty_name": "Ubuntu 22.04.3 LTS",
4141
"cpe_name": null,
42-
"home_url": "https://www.debian.org/",
42+
"home_url": "https://www.ubuntu.com/",
4343
"documentation_url": null,
44-
"support_url": "https://www.debian.org/support",
45-
"bug_report_url": "https://bugs.debian.org/",
46-
"privacy_policy_url": null,
44+
"support_url": "https://help.ubuntu.com/",
45+
"bug_report_url": "https://bugs.launchpad.net/ubuntu/",
46+
"privacy_policy_url": "https://www.ubuntu.com/legal/terms-and-policies/privacy-policy",
4747
"build_id": null,
4848
"variant": null,
4949
"variant_id": null,
5050
"logo": null,
51-
"extra_data": {}
51+
"extra_data": {
52+
"UBUNTU_CODENAME": "jammy"
53+
}
5254
}
5355
}
5456
]
@@ -355,9 +357,9 @@
355357
"status": "ignored-not-interesting",
356358
"tag": "",
357359
"extension": "",
358-
"md5": "8589b473401e7ebcca5d97204405c887",
359-
"sha1": "29420ee3cb176f64209d5beddc5713133fa7c2d4",
360-
"sha256": "aa6ccd5b1ade06c11f679cc781bdd3158f1007266ea391ed98a1bbf365641fd4",
360+
"md5": "fd30c92c61acbdebbd205e33534ac9bc",
361+
"sha1": "46d2cadf740c18ed8a1b30dbd7f5eeee521e1e8f",
362+
"sha256": "4bde2c39f541afb5ac413a03c8e5f57aa99b8fab304a62386dc0b16044cc0e2d",
361363
"sha512": "",
362364
"programming_language": "",
363365
"is_binary": false,

0 commit comments

Comments
 (0)