From fffa22e6af01a8f89d288f488625eba732ca662b Mon Sep 17 00:00:00 2001 From: makefu Date: Sat, 24 Dec 2011 15:03:05 +0100 Subject: //assets/truth2json: abs path now relative --- assets/bin/truth2json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/bin/truth2json b/assets/bin/truth2json index 53af7dc8..f85445b4 100755 --- a/assets/bin/truth2json +++ b/assets/bin/truth2json @@ -5,7 +5,7 @@ import sys try: db=sys.argv[1] except: - db="/krebs/db/truth" + db="../../db/truth" ret = {} -- cgit v1.2.3 From 6e49a121fd3369d0724c5db80a7807e630a261f4 Mon Sep 17 00:00:00 2001 From: makefu Date: Sat, 24 Dec 2011 15:07:27 +0100 Subject: //assets:asq->fast, asq is now the right name for the truth-querying tool --- assets/README | 15 +++++++++------ assets/bin/asq | 22 ++-------------------- assets/bin/fast | 20 ++++++++++++++++++++ 3 files changed, 31 insertions(+), 26 deletions(-) create mode 100755 assets/bin/fast diff --git a/assets/README b/assets/README index f1875194..7f90bfbf 100644 --- a/assets/README +++ b/assets/README @@ -21,17 +21,20 @@ Example: ass set bob-pc owner bob ass set bob-pc location bob\'s-home -### asq (ass-quick) -asq is a wrapper around the core ass. It should be used for adding lots and lots of new entries to the truth. It evaluates Variables from your environment. +### asq +asq is a tool to query the truth for facts. This is currently only a placeholder + +### FAST +fast is a wrapper around the core ass. It should be used for adding lots and lots of new entries to the truth. It evaluates Variables from your environment. Example: export ASS_LOCATION=bob\'s-home export ASS_OWNER=bob - asq c logitech-sidewinder-gamepad - asq c arduino-uno - asq s amount 3 + fast c logitech-sidewinder-gamepad + fast c arduino-uno + fast s amount 3 -asq will then actually generate the following: +fast will then actually generate the following: ass create logitech-sidewinder-gamepad ass set logitech-sidewinder-gamepad owner bob ass set logitech-sidewinder-gamepad location bob\'s-home diff --git a/assets/bin/asq b/assets/bin/asq index 41725d0b..0204e05b 100755 --- a/assets/bin/asq +++ b/assets/bin/asq @@ -1,20 +1,2 @@ -#!/bin/bash -set -xeuf -cd $(dirname $(readlink -f $0)) - -if [ "$1" == "c" ];then - ./ass create "$2" && export ASS_CREATED="$2" - for i in `env | grep -v '^ASS_CREATED=' | grep "^ASS" | cut -d '=' -f 1`;do - e=`echo $i | cut -d '_' -f 2 | tr '[A-Z]' '[a-z]'` - eval con=\$$i - $0 s "$e" "$con" - done -else if [ "$1" == "s" ] -then - ./ass set "${ASS_CREATED}" "${2}" "${3}" - else - echo "you are made of stupid!" - cat $0 - exit 23 - fi -fi +#!/bin/something +# placeholder to asq the truth for facts diff --git a/assets/bin/fast b/assets/bin/fast new file mode 100755 index 00000000..41725d0b --- /dev/null +++ b/assets/bin/fast @@ -0,0 +1,20 @@ +#!/bin/bash +set -xeuf +cd $(dirname $(readlink -f $0)) + +if [ "$1" == "c" ];then + ./ass create "$2" && export ASS_CREATED="$2" + for i in `env | grep -v '^ASS_CREATED=' | grep "^ASS" | cut -d '=' -f 1`;do + e=`echo $i | cut -d '_' -f 2 | tr '[A-Z]' '[a-z]'` + eval con=\$$i + $0 s "$e" "$con" + done +else if [ "$1" == "s" ] +then + ./ass set "${ASS_CREATED}" "${2}" "${3}" + else + echo "you are made of stupid!" + cat $0 + exit 23 + fi +fi -- cgit v1.2.3 From c4c9a613623650ebf703dc4c4a5219ba7d65e0aa Mon Sep 17 00:00:00 2001 From: makefu Date: Sat, 24 Dec 2011 15:09:57 +0100 Subject: //streams/Makefile: write streams symlink once --- streams/Makefile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/streams/Makefile b/streams/Makefile index 209eb656..ab5d1429 100644 --- a/streams/Makefile +++ b/streams/Makefile @@ -1,12 +1,16 @@ INITD = $(shell test -e /etc/rc.d/ && echo /etc/rc.d/ || echo /etc/init.d/) streams = $(shell cut -d\ -f2 stream.db) + + CURRDIR = ${PWD} .PHONY: all $(streams) +local: ../bin/streams +../bin/streams: + ln -sf $$PWD/streams ../bin/streams all: $(streams) @update-rc.d groove defaults 2>/dev/null || echo "** put groove daemon in DAEMONS in /etc/rc.conf" -$(streams): +$(streams): local @test -L $(INITD)$@ || test ! -e $(INITD)$@ && \ ln -n -s -f $$PWD/stream-starter $(INITD)$@ && echo "writing $@ to $(INITD)" - ln -sf $$PWD/streams ../bin/streams -- cgit v1.2.3