Created
July 11, 2016 01:56
-
-
Save BrentonEarl/bd48e1a37f63d9fbda2b92cc53297e22 to your computer and use it in GitHub Desktop.
Search for all SlackBuilds related to or that contain the keyword as a dependency.
This file contains 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/env python | |
import argparse, os, subprocess | |
parser = argparse.ArgumentParser() | |
parser.add_argument("directory", help="The repository directory - /var/lib/sbopkg/{SBo,SBo-git}/") | |
parser.add_argument("requires", help="Search SlackBuilds for a dependency or related SlackBuild") | |
args = parser.parse_args() | |
for root, dirs, files in os.walk(args.directory): | |
for file in files: | |
if file.endswith(".info"): | |
list = os.path.join(root,file) | |
with open(list, "r") as f: | |
for line in f: | |
if args.requires in line: | |
print(os.path.dirname(list)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Output on Slackware 14.2