diff options
Diffstat (limited to 'src/backend/search.py')
-rw-r--r-- | src/backend/search.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/backend/search.py b/src/backend/search.py index d718c7e..e68cd2d 100644 --- a/src/backend/search.py +++ b/src/backend/search.py @@ -6,6 +6,7 @@ import sisyphus.checkenv import sisyphus.getfs import sisyphus.update + def searchDB(filter, cat = '', pn = '', desc = ''): NOVIRT = "AND cat NOT LIKE 'virtual'" SELECTS = { @@ -99,9 +100,11 @@ def searchDB(filter, cat = '', pn = '', desc = ''): return rows + def tosql(string): return '%%' if string == '' else string.replace('*', '%').replace('?', '_') + def showSearch(filter, cat, pn, desc, single): print(f"Searching {filter} packages ... \n") pkglist = searchDB(filter, tosql(cat), tosql(pn), tosql(desc)) @@ -125,6 +128,7 @@ def showSearch(filter, cat, pn, desc, single): print(f"{cpn:45} {str(pkg['iv']):20} {str(pkg['av'])}") print(f"\nFound {len(pkglist)} matching package(s) ...") + def start(filter, cat, pn, desc, single): if sisyphus.checkenv.root(): sisyphus.update.start() @@ -133,5 +137,6 @@ def start(filter, cat, pn, desc, single): showSearch(filter, cat, pn, desc, single) + def estart(pkgname): subprocess.call(['emerge', '--search', '--getbinpkg'] + list(pkgname)) |