summaryrefslogtreecommitdiff
path: root/src/backend/search.py
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2022-10-30 20:02:58 +0000
committerV3n3RiX <venerix@koprulu.sector>2022-10-30 20:02:58 +0000
commit206c993e45c39e60eceae1f66c69d39903ab9266 (patch)
tree96e15cacf4f5ad804fb97f0fb37584c6d064acfd /src/backend/search.py
parent80d633d0738461d7715e5051ab7f3248068fa87e (diff)
space functions a bit
Diffstat (limited to 'src/backend/search.py')
-rw-r--r--src/backend/search.py5
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))