Created
July 17, 2025 10:16
-
-
Save crazo7924/3dcb28e8bc89b9f0b403eb90403630d1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python3 | |
| import os | |
| import subprocess | |
| import sys | |
| modlist_file = sys.argv[1] | |
| mod_location = os.getcwd() | |
| modlist = set() | |
| with open(modlist_file) as f: | |
| for mod in f: | |
| result = subprocess.run( | |
| ["modinfo", f"{mod_location}/{mod}".replace("\n", "")], | |
| stdout=subprocess.PIPE, | |
| text=True, | |
| ) | |
| depends_line = [ | |
| x.split(":")[1].strip().split(",") | |
| for x in result.stdout.splitlines() | |
| if "depends" in x | |
| ][0] | |
| if len(depends_line) == 1 and depends_line[0] != "": | |
| modlist.update(depends_line) | |
| print(*[x + ".ko" for x in modlist], sep="\n") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment