diff mbox series

[3/4] fetch2: npmsw: ignore bundled dependencies in packages

Message ID 20241209103158.20833-3-stefan.herbrechtsmeier-oss@weidmueller.com
State New
Headers show
Series [1/4] tests: fetch: adapt npmsw tests to fixed unpack behavior | expand

Commit Message

Stefan Herbrechtsmeier Dec. 9, 2024, 10:31 a.m. UTC
From: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>

The npm package lock and shrinkwrap file list bundled dependencies which
are supplied together with the parent dependency. The flag depends on
the lock file version. Add the missing `inBundle` flag to packages list
processing.

Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
---

 lib/bb/fetch2/npmsw.py | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/lib/bb/fetch2/npmsw.py b/lib/bb/fetch2/npmsw.py
index a5fa598de..558c9a2b0 100644
--- a/lib/bb/fetch2/npmsw.py
+++ b/lib/bb/fetch2/npmsw.py
@@ -66,6 +66,8 @@  def foreach_dependencies(shrinkwrap, callback=None, dev=False):
                 package_infos = packages.get(package, {})
                 if dev == False and package_infos.get("dev", False):
                     continue
+                elif package_infos.get("inBundle", False):
+                    continue
                 callback(name, package_infos, package)
     else:
         _walk_deps(shrinkwrap.get("dependencies", {}), [])