[kernel-team] 01/01: Add script to show reverse dependencies of an installed module

debian-kernel at lists.debian.org debian-kernel at lists.debian.org
Fri Apr 8 11:36:32 UTC 2016


This is an automated email from the git hooks/post-receive script.

benh pushed a commit to branch master
in repository kernel-team.

commit 04c33d258b133eee4ecf691025dfc28bec0b25f0
Author: Ben Hutchings <ben at decadent.org.uk>
Date:   Fri Apr 8 12:36:25 2016 +0100

    Add script to show reverse dependencies of an installed module
---
 scripts/benh/show-module-rdeps | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/scripts/benh/show-module-rdeps b/scripts/benh/show-module-rdeps
new file mode 100755
index 0000000..628556b
--- /dev/null
+++ b/scripts/benh/show-module-rdeps
@@ -0,0 +1,19 @@
+#!/usr/bin/python3
+
+import os, os.path, re, sys
+
+def main(kver, root):
+    mod_path_re = re.compile(r'^(?:.*/)?([^/]+)\.ko$')
+    rdeps = {}
+    with open(os.path.join('/lib/modules', kver, 'modules.dep')) as dep_file:
+        for line in dep_file:
+            left, right = line.split(':', 1)
+            dependent = mod_path_re.sub(r'\1', left)
+            for dependency in [mod_path_re.sub(r'\1', mod_path) for
+                               mod_path in right.strip().split()]:
+                rdeps.setdefault(dependency, []).append(dependent)
+    for name in sorted(rdeps.get(root, [])):
+        print(name)
+
+if __name__ == '__main__':
+    main(*sys.argv[1:])

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/kernel/kernel-team.git



More information about the Kernel-svn-changes mailing list