| |
@@ -610,39 +610,6 @@
|
| |
return requirement
|
| |
|
| |
|
| |
- def has_only_bundled_dependencies(module_dir_path):
|
| |
- """Determines if the module contains only bundled dependencies.
|
| |
-
|
| |
- Dependencies are considered un-bundled when they are symlinks
|
| |
- pointing outside the root module's tree.
|
| |
-
|
| |
- Arguments:
|
| |
- module_dir_path (str):
|
| |
- Path to the module directory (directory with ``package.json``).
|
| |
-
|
| |
- Returns:
|
| |
- bool: True if all dependencies are bundled, False otherwise.
|
| |
- """
|
| |
-
|
| |
- module_root_path = os.path.abspath(module_dir_path)
|
| |
- dependency_root_path = os.path.join(module_root_path, "node_modules")
|
| |
-
|
| |
- try:
|
| |
- dependency_path_iter = (
|
| |
- os.path.join(dependency_root_path, basename)
|
| |
- for basename in os.listdir(dependency_root_path)
|
| |
- )
|
| |
- bundled_dependency_iter = (
|
| |
- os.path.realpath(path)
|
| |
- for path in dependency_path_iter
|
| |
- if not os.path.islink(path) or not path.startswith(module_root_path)
|
| |
- )
|
| |
-
|
| |
- return any(bundled_dependency_iter)
|
| |
- except OSError: # node_modules does not exist
|
| |
- return False
|
| |
-
|
| |
-
|
| |
def extract_dependencies(metadata_path, optional=False):
|
| |
"""Extract all dependencies in RPM format from package metadata.
|
| |
|
| |
@@ -659,9 +626,6 @@
|
| |
TypeError: Invalid dependency data type.
|
| |
"""
|
| |
|
| |
- if has_only_bundled_dependencies(os.path.dirname(metadata_path)):
|
| |
- return # skip
|
| |
-
|
| |
# Read metadata
|
| |
try:
|
| |
with open(metadata_path, mode="r") as metadata_file:
|
| |
This will ensure that the nodejs(engine) dependency is always added,
along with any Suggests: optionalDependencies.
Signed-off-by: Stephen Gallagher sgallagh@redhat.com