Skip to content

Commit 98adc97

Browse files
committed
improve module resolution
Signed-off-by: Zen <[email protected]>
1 parent 690b48e commit 98adc97

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "ugrd"
7-
version = "1.8.3"
7+
version = "1.8.4"
88
authors = [
99
{ name="Desultory", email="[email protected]" },
1010
]

src/ugrd/kmod/kmod.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
__author__ = 'desultory'
2-
__version__ = '2.5.3'
2+
__version__ = '2.5.4'
33

44
from pathlib import Path
55
from subprocess import run
@@ -199,8 +199,10 @@ def _process_kmod_dependencies(self, kmod: str) -> None:
199199
dependencies += sofdeps
200200

201201
for dependency in dependencies:
202-
if dependency in self['kmod_ignore'] and self['_kmod_modinfo'][dependency]['filename'] != '(builtin)':
203-
raise DependencyResolutionError("[%s] Kernel module dependency is in ignore list: %s" % (kmod, dependency))
202+
if dependency in self['kmod_ignore']: # Don't add modules with ignored dependencies
203+
if modinfo := self['_kmod_modinfo'].get(dependency):
204+
if modinfo['filename'] != '(builtin)': # But if it's ignored because it's built-in, that's fine
205+
raise DependencyResolutionError("[%s] Kernel module dependency is in ignore list: %s" % (kmod, dependency))
204206
self.logger.debug("[%s] Processing dependency: %s" % (kmod, dependency))
205207
_process_kmod_dependencies(self, dependency)
206208
self['kernel_modules'] = dependency
@@ -242,7 +244,7 @@ def process_modules(self) -> None:
242244
try:
243245
_process_kmod_dependencies(self, kmod)
244246
continue
245-
except BuiltinModuleError as e:
247+
except (IgnoredModuleError, BuiltinModuleError) as e:
246248
self.logger.info(e)
247249
except DependencyResolutionError as e:
248250
if kmod in self['kmod_init']:

0 commit comments

Comments
 (0)