From 3877e5d8221d42811d376ddb560552684d34f5cc Mon Sep 17 00:00:00 2001 From: EUcancER Date: Thu, 17 Nov 2011 11:16:48 +0100 Subject: //punani: rm old punani, tightnani->punani --- punani/tightnani/tightnani-web.py | 58 ------------------------------------- punani/tightnani/tightnani_db | 60 --------------------------------------- punani/tightnani/tinani | 59 -------------------------------------- 3 files changed, 177 deletions(-) delete mode 100755 punani/tightnani/tightnani-web.py delete mode 100644 punani/tightnani/tightnani_db delete mode 100755 punani/tightnani/tinani (limited to 'punani/tightnani') diff --git a/punani/tightnani/tightnani-web.py b/punani/tightnani/tightnani-web.py deleted file mode 100755 index 4e6a64a4..00000000 --- a/punani/tightnani/tightnani-web.py +++ /dev/null @@ -1,58 +0,0 @@ -#!/usr/bin/python - -import web -import json - -urls = ( - '/', 'Index', - '/dump','Dump', - '/reload','Reload', - '/(.+)/(.+)', 'ArchFinder', -) - - -PDB_FILE="tightnani_db" -f = open(PDB_FILE) -pdb= json.load(f) -f.close() - -class Index: - def GET(self): - ret = """Welcome to the Tightnani API
-Retrieve a package name for your distribution with: /PACKER/PKG""" - return ret - -class Reload: - def GET(self): - f = open(PDB_FILE) - pdb= json.load(f) - f.close() - return "DB reloaded" - - -class Dump: - def GET(self): - return json.dumps(pdb,sort_keys=True,indent=4) - -class ArchFinder: - def GET(self,packer,package): - 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() - return "not found. i'm so sorry :(" - 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 deleted file mode 100644 index 318f0e27..00000000 --- a/punani/tightnani/tightnani_db +++ /dev/null @@ -1,60 +0,0 @@ -{ - "packer-symlinks" : { - "packer" : "yaourt", - "aptitude" : "apt-get", - "bauerbill" : "yaourt" - }, - "super-packer" : { - "yaourt" : "pacman" - }, - "vim" : { - "apt-get" : "vim", - "pacman" : "vim", - "brew" : "vim", - "yum" : "vim" - }, - "python" : { - "apt-get" : "python", - "pacman" : "python2" - }, - "python2" : { - "apt-get" : "python", - "pacman" : "python2" - }, - "python3" : { - "apt-get" : "python3", - "pacman" : "python" - }, - "tinc" : { - "apt-get" : "tinc", - "yaourt" : "tinc" - }, - "python-notify" : { - "pacman" : "python-notify", - "apt-get" : "python-notify" - }, - "python-dbus" : { - "pacman" : "dbus-python", - "apt-get" : "python-dbus" - }, - "w3m" : { - "pacman" : "w3m", - "apt-get" : "w3m" - }, - "make" : { - "pacman" : "make", - "apt-get" : "make" - }, - "perl-xml-simple" : { - "apt-get" : "libxml-simple-perl", - "pacman" : "perl-xml-simple" - }, - "hostname" : { - "pacman" : "inetutils", - "apt-get" : "hostname" - }, - "pip" : { - "pacman" : "python-pip", - "apt-get" : "python-pip" - } -} diff --git a/punani/tightnani/tinani b/punani/tightnani/tinani deleted file mode 100755 index 8caf669e..00000000 --- a/punani/tightnani/tinani +++ /dev/null @@ -1,59 +0,0 @@ -#!/bin/bash -set -euf - -if [ $# -ne 2 ];then - echo "usage: `basename $0` (install|remove) PACKAGE" - exit 23 -fi - -PACKERS="yum!-y install remove -brew install remove -pacman!--noconfirm -S!--needed -Rcs -bauerbill!--noconfirm -S!--needed -Rcs -yaourt!--noconfirm -S!--needed -Rcs -packer!--noconfirm -S!--needed -Rcs -apt-get!--yes install remove -aptitude!--yes install remove" - -OIFS=$IFS -PACKER= -IFS=' -' - -TIGHTNANI_HOST="http://euer.krebsco.de:9111" -# Find suitable packer -for PACKER_LINE in $PACKERS; do - TRY_PACKER_CMD="$(echo "$PACKER_LINE" | cut -d ' ' -f 1)" - TRY_PACKER="$(echo "$TRY_PACKER_CMD" | cut -d '!' -f 1)" - if which $TRY_PACKER &>/dev/null; then - PACKER=$TRY_PACKER - PACKER_CMD="$(echo "$TRY_PACKER_CMD" | tr "!" " ")" - echo "you got $PACKER" - INSTALL_PARAM="$(echo "$PACKER_LINE" | cut -d ' ' -f 2 | tr "!" " ")" - REMOVE_PARAM="$(echo "$PACKER_LINE" | cut -d ' ' -f 3 | tr "!" " ")" - fi -done -IFS=$OIFS -if [ ! "$PACKER" ];then - echo "Could not find a supported packer for you, bailing out!" - exit 23 -fi - - -# find the package name -PKG="$2" -RESOLVED=`wget -O- $TIGHTNANI_HOST/$PACKER/$PKG 2>/dev/null` -if [ ! "$RESOLVED" ];then - echo "Could not resolve your requested package, bailing out!" - exit 23 -fi -case "$1" in - install) - exec $PACKER_CMD $INSTALL_PARAM $RESOLVED - ;; - remove) - exec $PACKER_CMD $REMOVE_PARAM $RESOLVED - ;; - *) - echo "usage: `basename $0` (install|remove) PACKAGE" -esac -- cgit v1.2.3