diff options
author | EUcancER <root@euer.krebsco.de> | 2011-11-16 18:35:13 +0100 |
---|---|---|
committer | EUcancER <root@euer.krebsco.de> | 2011-11-16 18:35:13 +0100 |
commit | c97518523b910ca7412f69de3803739affe2c583 (patch) | |
tree | 87d8bad9bbb2a04bcfd0c8e93ac86d42700eb238 /punani | |
parent | 57239fa65d74feecf6ac7692a728d647c022283c (diff) |
//punani: tightnani-web is now able to handle fallback(super-) package manager
Diffstat (limited to 'punani')
-rwxr-xr-x | punani/tightnani/tightnani-web.py | 7 | ||||
-rw-r--r-- | punani/tightnani/tightnani_db | 3 |
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", |