summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xpunani/tightnani/tightnani-web.py7
-rw-r--r--punani/tightnani/tightnani_db3
2 files changed, 9 insertions, 1 deletions
diff --git a/punani/tightnani/tightnani-web.py b/punani/tightnani/tightnani-web.py
index 52f5004f..4386bbae 100755
--- a/punani/tightnani/tightnani-web.py
+++ b/punani/tightnani/tightnani-web.py
@@ -18,7 +18,7 @@ pdb= json.load(open(PDB_FILE))
class Index:
def GET(self):
ret = """Welcome to the Tightnani API<br/>
-Retrieve a package name for your distribution with: /ARCH/PKG"""
+Retrieve a package name for your distribution with: /PACKER/PKG"""
return ret
class Reload:
@@ -36,13 +36,18 @@ class ArchFinder:
if not packer or not package: web.BadRequest()
else:
packer = pdb['packer-symlinks'].get(packer,packer) #try to resolve similar packers
+ super_packer = pdb['super-packer'].get(packer,'')
ret = pdb.get(package,{}).get(packer,False)
+ ret = ret if ret else pdb.get(package,{}).get(super_packer,False)
+
if not ret: web.NotFound()
else: return ret
if __name__ == "__main__":
+ import sys
+ sys.argv.append("9111")
app = web.application(urls,globals())
app.internalerror = web.debugerror
app.run()
diff --git a/punani/tightnani/tightnani_db b/punani/tightnani/tightnani_db
index d15a9ad4..4c2d4843 100644
--- a/punani/tightnani/tightnani_db
+++ b/punani/tightnani/tightnani_db
@@ -4,6 +4,9 @@
"aptitude" : "apt-get",
"bauerbill" : "yaourt"
},
+ "super-packer" : {
+ "yaourt" : "pacman"
+ },
"vim" : {
"apt-get" : "vim",
"pacman" : "vim",