Browse Source

Drop d; this is not a daemon

Alois Mahdal 11 years ago
parent
commit
1e20d6ddf8
21 changed files with 186 additions and 186 deletions
  1. 5
    5
      Makefile
  2. 5
    5
      README
  3. 3
    3
      bin/ffdoc.in
  4. 5
    5
      bin/fff.in
  5. 10
    10
      bin/ffmanage.in
  6. 4
    4
      doc/examples/template.sh.in
  7. 10
    10
      doc/ffoo.3.md
  8. 81
    0
      ffoo.sh.in
  9. 0
    81
      ffood.sh.in
  10. 6
    6
      include/core.sh
  11. 8
    8
      include/mkpretty_color.sh
  12. 4
    4
      include/proj_ol.sh
  13. 1
    1
      include/recon.sh
  14. 2
    2
      include/sw.sh
  15. 17
    17
      include/termcolors.sh
  16. 5
    5
      include/testing.sh
  17. 1
    1
      include/www.sh
  18. 1
    1
      include/xorg.sh
  19. 2
    2
      notes/TODO.md
  20. 14
    14
      setup/mk.sh
  21. 2
    2
      test/iniread.in

+ 5
- 5
Makefile View File

1
-# ffood - Fast Food - a Bash Library
1
+# ffoo - Fast Foo - a Bash Library
2
 # See LICENSE file for copyright and license details.
2
 # See LICENSE file for copyright and license details.
3
 
3
 
4
 include config.mk
4
 include config.mk
5
 
5
 
6
-all: options doc ffood
6
+all: options doc ffoo
7
 
7
 
8
 options:
8
 options:
9
-	@echo ffood build options:
9
+	@echo ffoo build options:
10
 	@echo "VERSION  = ${VERSION}"
10
 	@echo "VERSION  = ${VERSION}"
11
 	@echo "PREFIX   = ${PREFIX}"
11
 	@echo "PREFIX   = ${PREFIX}"
12
 
12
 
19
 manpages:
19
 manpages:
20
 	@setup/mk.sh manpages
20
 	@setup/mk.sh manpages
21
 
21
 
22
-ffood:
23
-	@setup/mk.sh ffood
22
+ffoo:
23
+	@setup/mk.sh ffoo
24
 
24
 
25
 test: install
25
 test: install
26
 	@setup/mk.sh test
26
 	@setup/mk.sh test

+ 5
- 5
README View File

1
-Fast Food Bash library
2
-======================
1
+Fast Foo Bash library
2
+=====================
3
 
3
 
4
-ffood - Fast Food - a Bash Library
4
+ffoo - Fast Foo - a Bash Library
5
 
5
 
6
 
6
 
7
 NOTES
7
 NOTES
27
     This is "fixed" by adding at least one all-matching `grep`
27
     This is "fixed" by adding at least one all-matching `grep`
28
     command before the while loop.
28
     command before the while loop.
29
 
29
 
30
- *  iniread: when same key is found in eg. /etc/ffood/ffood.ini
31
-    and ~/.ffood.ffood.ini, output is concatenated.  If you
30
+ *  iniread: when same key is found in eg. /etc/ffoo/ffoo.ini
31
+    and ~/.ffoo.ffoo.ini, output is concatenated.  If you
32
     want the value be rather overriden, you can simply add
32
     want the value be rather overriden, you can simply add
33
     `-1` to limit output to the last one.
33
     `-1` to limit output to the last one.
34
 
34
 

+ 3
- 3
bin/ffdoc.in View File

1
 #!/bin/bash
1
 #!/bin/bash
2
 
2
 
3
-. __FFOOD_DIR__/ffood.sh
3
+. __FFOO_DIR__/ffoo.sh
4
 
4
 
5
-ffood import core
5
+ffoo import core
6
 
6
 
7
 
7
 
8
 usage() {
8
 usage() {
11
 
11
 
12
 target=$1
12
 target=$1
13
 test -n "$target" || usage
13
 test -n "$target" || usage
14
-ffood doc "$target"
14
+ffoo doc "$target"

+ 5
- 5
bin/fff.in View File

1
 #!/bin/bash
1
 #!/bin/bash
2
 
2
 
3
-. __FFOOD_DIR__/ffood.sh
3
+. __FFOO_DIR__/ffoo.sh
4
 
4
 
5
-ffood import core
5
+ffoo import core
6
 
6
 
7
 
7
 
8
 usage() {
8
 usage() {
14
 while true; do
14
 while true; do
15
     case $1 in
15
     case $1 in
16
         -d|--debug)
16
         -d|--debug)
17
-            FFOOD_DEBUG=true
17
+            FFOO_DEBUG=true
18
             shift 1
18
             shift 1
19
             ;;
19
             ;;
20
         -v|--verbose)
20
         -v|--verbose)
21
-            FFOOD_VERBOSE=true
21
+            FFOO_VERBOSE=true
22
             shift 1
22
             shift 1
23
             ;;
23
             ;;
24
         -I|--include)
24
         -I|--include)
39
 done
39
 done
40
 
40
 
41
 for i in $(tr ":" " " <<<"$includes"); do
41
 for i in $(tr ":" " " <<<"$includes"); do
42
-    ffood import $i
42
+    ffoo import $i
43
 done
43
 done
44
 
44
 
45
 "$@"
45
 "$@"

+ 10
- 10
bin/ffmanage.in View File

1
 #!/bin/bash
1
 #!/bin/bash
2
 
2
 
3
-. __FFOOD_DIR__/ffood.sh
3
+. __FFOO_DIR__/ffoo.sh
4
 
4
 
5
-ffood import core
5
+ffoo import core
6
 
6
 
7
 
7
 
8
 usage() {
8
 usage() {
13
 }
13
 }
14
 
14
 
15
 version_info() {
15
 version_info() {
16
-    echo "$(basename $0) (Fast Food bash library) $FFOOD_VERSION"
16
+    echo "$(basename $0) (Fast Foo bash library) $FFOO_VERSION"
17
     echo
17
     echo
18
-    echo "install path: __FFOOD_DIR__"
19
-    echo "data path: $FFOOD_DATA_DIR"
18
+    echo "install path: __FFOO_DIR__"
19
+    echo "data path: $FFOO_DATA_DIR"
20
 }
20
 }
21
 
21
 
22
 while true; do case $1 in
22
 while true; do case $1 in
23
         -d|--debug)
23
         -d|--debug)
24
-            FFOOD_DEBUG=true;
24
+            FFOO_DEBUG=true;
25
             shift;
25
             shift;
26
             ;;
26
             ;;
27
         --library-init)
27
         --library-init)
28
-            echo "__FFOOD_DIR__/ffood.sh"
28
+            echo "__FFOO_DIR__/ffoo.sh"
29
             exit 0
29
             exit 0
30
             ;;
30
             ;;
31
         --list-modules)
31
         --list-modules)
32
-            ffood _list_all_modules
32
+            ffoo _list_all_modules
33
             exit $?
33
             exit $?
34
             ;;
34
             ;;
35
         --list-functions)
35
         --list-functions)
36
             if test -n "$2";
36
             if test -n "$2";
37
             then
37
             then
38
-                ffood _list_functions_in_mfile $(ffood _list_mfiles_like $2)
38
+                ffoo _list_functions_in_mfile $(ffoo _list_mfiles_like $2)
39
                 exit $?
39
                 exit $?
40
             else
40
             else
41
-                ffood _list_all_functions
41
+                ffoo _list_all_functions
42
                 exit $?
42
                 exit $?
43
             fi
43
             fi
44
             ;;
44
             ;;

+ 4
- 4
doc/examples/template.sh.in View File

1
 #!/bin/bash
1
 #!/bin/bash
2
 
2
 
3
-. __FFOOD_DIR__/ffood.sh
3
+. __FFOO_DIR__/ffoo.sh
4
 
4
 
5
-ffood import core
5
+ffoo import core
6
 
6
 
7
-FFOOD_VERBOSE=true
8
-FFOOD_DEBUG=true
7
+FFOO_VERBOSE=true
8
+FFOO_DEBUG=true

doc/ffood.3.md → doc/ffoo.3.md View File

1
-FFOOD
2
-=====
1
+FFOO
2
+====
3
 
3
 
4
 SYNOPSIS
4
 SYNOPSIS
5
 --------
5
 --------
6
 
6
 
7
     #!/bin/bash
7
     #!/bin/bash
8
     # ~/bin/example
8
     # ~/bin/example
9
-    source /usr/share/lib/ffood/ffood.sh
10
-    ffood import core
9
+    source /usr/share/lib/ffoo/ffoo.sh
10
+    ffoo import core
11
 
11
 
12
     # basic echo helpers
12
     # basic echo helpers
13
-    think "about saying something..."   # like echo if FFOOD_VERBOSE
13
+    think "about saying something..."   # like echo if FFOO_VERBOSE
14
     warn "this is just an example"      # obvious :)
14
     warn "this is just an example"      # obvious :)
15
     false || die "false was true!"      # Perlism :)
15
     false || die "false was true!"      # Perlism :)
16
     x=1; y=2; z=3
16
     x=1; y=2; z=3
21
     echo "hello" | debug_pipe mypipe    # debug:PIPE mypipe: hello
21
     echo "hello" | debug_pipe mypipe    # debug:PIPE mypipe: hello
22
 
22
 
23
     # more advanced functions
23
     # more advanced functions
24
-    FFOOD_DATADIR=$HOME/.example
25
-    cat >$FFOOD_DATADIR/main.ini <<EOF
24
+    FFOO_DATADIR=$HOME/.example
25
+    cat >$FFOO_DATADIR/main.ini <<EOF
26
     # a sample ini file
26
     # a sample ini file
27
     [mysection]
27
     [mysection]
28
         key = something
28
         key = something
38
     python sample.py                        # "will work!" due to the -S
38
     python sample.py                        # "will work!" due to the -S
39
 
39
 
40
     # even more
40
     # even more
41
-    ffood import recon
41
+    ffoo import recon
42
     wait_until -e ! test -e badfile         # -e means use eval (make "!" work)
42
     wait_until -e ! test -e badfile         # -e means use eval (make "!" work)
43
     think "the badfile is away..."
43
     think "the badfile is away..."
44
     bad_file_away() {                       # but you can avoid eval
44
     bad_file_away() {                       # but you can avoid eval
47
     wait_until bad_file_away
47
     wait_until bad_file_away
48
 
48
 
49
     # ... and more
49
     # ... and more
50
-    ffood import recon
50
+    ffoo import recon
51
     register_artifact this_file_will_exist.log
51
     register_artifact this_file_will_exist.log
52
     some_important_program > this_file_will_exist.log
52
     some_important_program > this_file_will_exist.log
53
     collect_artifacts                       # will preserve tree from /
53
     collect_artifacts                       # will preserve tree from /
54
 
54
 
55
     # ...AND MORE!
55
     # ...AND MORE!
56
-    ffood import sw
56
+    ffoo import sw
57
     cat > dependencies.ini <<EOF
57
     cat > dependencies.ini <<EOF
58
     [needs/now]
58
     [needs/now]
59
         yum = ronn
59
         yum = ronn

+ 81
- 0
ffoo.sh.in View File

1
+#!/bin/bash
2
+
3
+FFOO_DATA_DIR=${FFOO_DATA_DIR:-$HOME/.ffoo}
4
+FFOO_DIR=${FFOO_DIR:-__FFOO_DIR__}
5
+FFOO_ARTIFACTS_DIR=${FFOO_ARTIFACTS_DIR:-artifacts}
6
+FFOO_DEBUG=${FFOO_DEBUG:-false}
7
+FFOO_DEBUGINIT=${FFOO_DEBUGINIT:-false}
8
+FFOO_INCLUDE=${FFOO_INCLUDE:-$FFOO_DIR/include}
9
+FFOO_MKPRETTY=${FFOO_MKPRETTY:-plain}
10
+FFOO_VERBOSE=${FFOO_VERBOSE:-false}
11
+FFOO_VERSION=__VERSION__
12
+
13
+ffoo() {
14
+    case $1 in
15
+        __debug)
16
+            $FFOO_DEBUGINIT || return 0
17
+            shift
18
+            echo "debug: $@" >&2
19
+            ;;
20
+        __die)
21
+            shift
22
+            echo "$@" >&2
23
+            exit 1
24
+            ;;
25
+        doc)
26
+            ffoo __die "not implemented (sorry...)"
27
+            ;;
28
+        import)
29
+            ffoo __debug "importing module $2"
30
+            local mfile=$(ffoo _list_mfiles_like $2 | head -1)
31
+            test -n "$mfile" || ffoo __die "cannot find module $2"
32
+            ffoo __debug "found module file: $mfile"
33
+            . $mfile
34
+            return $?
35
+            ;;
36
+        _list_all_functions)
37
+            local mfile
38
+            ffoo _list_all_mfiles | while read mfile;
39
+            do
40
+                ffoo _list_functions_in_mfile "$mfile"
41
+            done
42
+            ;;
43
+        _list_all_modules)
44
+            local mp mfn;
45
+            ffoo _list_all_mfiles | while read mp;
46
+            do
47
+                mfn="${mp##*/}"
48
+                echo "${mfn%%.sh}"
49
+            done
50
+            ;;
51
+        _list_all_mfiles)
52
+            {
53
+                echo $FFOO_INCLUDE/*.sh | tr ' ' '\n'
54
+                test -n "$FFOO_PATH" && echo $FFOO_PATH/*.sh
55
+            } | tr ' ' '\n'
56
+            ;;
57
+        _list_mfiles_like)
58
+            test -f "$FFOO_INCLUDE/$2.sh"                  && echo "$FFOO_INCLUDE/$2.sh"
59
+            test -n "$FFOO_PATH" -a -f "$FFOO_PATH/$2.sh" && echo "$FFOO_PATH/$2.sh"
60
+            ;;
61
+        _list_functions_in_mfile)
62
+            local mfile="$2"
63
+            grep -HE '^[[:alnum:]_]+\(\) \{' "$mfile" \
64
+              | sed -e 's/^.*\///; s/\.sh:/./; s/(.*//'
65
+            ;;
66
+        *)
67
+            ffoo __die "unknown ffoo command: $1"
68
+            ;;
69
+    esac
70
+}
71
+
72
+ffoo __debug "FFOO_DATA_DIR='$FFOO_DATA_DIR'"
73
+ffoo __debug "FFOO_DIR='$FFOO_DIR'"
74
+ffoo __debug "FFOO_ARTIFACTS_DIR='$FFOO_ARTIFACTS_DIR'"
75
+ffoo __debug "FFOO_DEBUG='$FFOO_DEBUG'"
76
+ffoo __debug "FFOO_DEBUGINIT='$FFOO_DEBUGINIT'"
77
+ffoo __debug "FFOO_INCLUDE='$FFOO_INCLUDE'"
78
+ffoo __debug "FFOO_INIPATH='$FFOO_INIPATH'"
79
+ffoo __debug "FFOO_MKPRETTY='$FFOO_MKPRETTY'"
80
+ffoo __debug "FFOO_VERBOSE='$FFOO_VERBOSE'"
81
+ffoo __debug "FFOO_VERSION='$FFOO_VERSION'"

+ 0
- 81
ffood.sh.in View File

1
-#!/bin/bash
2
-
3
-FFOOD_DATA_DIR=${FFOOD_DATA_DIR:-$HOME/.ffood}
4
-FFOOD_DIR=${FFOOD_DIR:-__FFOOD_DIR__}
5
-FFOOD_ARTIFACTS_DIR=${FFOOD_ARTIFACTS_DIR:-artifacts}
6
-FFOOD_DEBUG=${FFOOD_DEBUG:-false}
7
-FFOOD_DEBUGINIT=${FFOOD_DEBUGINIT:-false}
8
-FFOOD_INCLUDE=${FFOOD_INCLUDE:-$FFOOD_DIR/include}
9
-FFOOD_MKPRETTY=${FFOOD_MKPRETTY:-plain}
10
-FFOOD_VERBOSE=${FFOOD_VERBOSE:-false}
11
-FFOOD_VERSION=__VERSION__
12
-
13
-ffood() {
14
-    case $1 in
15
-        __debug)
16
-            $FFOOD_DEBUGINIT || return 0
17
-            shift
18
-            echo "debug: $@" >&2
19
-            ;;
20
-        __die)
21
-            shift
22
-            echo "$@" >&2
23
-            exit 1
24
-            ;;
25
-        doc)
26
-            ffood __die "not implemented (sorry...)"
27
-            ;;
28
-        import)
29
-            ffood __debug "importing module $2"
30
-            local mfile=$(ffood _list_mfiles_like $2 | head -1)
31
-            test -n "$mfile" || ffood __die "cannot find module $2"
32
-            ffood __debug "found module file: $mfile"
33
-            . $mfile
34
-            return $?
35
-            ;;
36
-        _list_all_functions)
37
-            local mfile
38
-            ffood _list_all_mfiles | while read mfile;
39
-            do
40
-                ffood _list_functions_in_mfile "$mfile"
41
-            done
42
-            ;;
43
-        _list_all_modules)
44
-            local mp mfn;
45
-            ffood _list_all_mfiles | while read mp;
46
-            do
47
-                mfn="${mp##*/}"
48
-                echo "${mfn%%.sh}"
49
-            done
50
-            ;;
51
-        _list_all_mfiles)
52
-            {
53
-                echo $FFOOD_INCLUDE/*.sh | tr ' ' '\n'
54
-                test -n "$FFOOD_PATH" && echo $FFOOD_PATH/*.sh
55
-            } | tr ' ' '\n'
56
-            ;;
57
-        _list_mfiles_like)
58
-            test -f "$FFOOD_INCLUDE/$2.sh"                  && echo "$FFOOD_INCLUDE/$2.sh"
59
-            test -n "$FFOOD_PATH" -a -f "$FFOOD_PATH/$2.sh" && echo "$FFOOD_PATH/$2.sh"
60
-            ;;
61
-        _list_functions_in_mfile)
62
-            local mfile="$2"
63
-            grep -HE '^[[:alnum:]_]+\(\) \{' "$mfile" \
64
-              | sed -e 's/^.*\///; s/\.sh:/./; s/(.*//'
65
-            ;;
66
-        *)
67
-            ffood __die "unknown ffood command: $1"
68
-            ;;
69
-    esac
70
-}
71
-
72
-ffood __debug "FFOOD_DATA_DIR='$FFOOD_DATA_DIR'"
73
-ffood __debug "FFOOD_DIR='$FFOOD_DIR'"
74
-ffood __debug "FFOOD_ARTIFACTS_DIR='$FFOOD_ARTIFACTS_DIR'"
75
-ffood __debug "FFOOD_DEBUG='$FFOOD_DEBUG'"
76
-ffood __debug "FFOOD_DEBUGINIT='$FFOOD_DEBUGINIT'"
77
-ffood __debug "FFOOD_INCLUDE='$FFOOD_INCLUDE'"
78
-ffood __debug "FFOOD_INIPATH='$FFOOD_INIPATH'"
79
-ffood __debug "FFOOD_MKPRETTY='$FFOOD_MKPRETTY'"
80
-ffood __debug "FFOOD_VERBOSE='$FFOOD_VERBOSE'"
81
-ffood __debug "FFOOD_VERSION='$FFOOD_VERSION'"

+ 6
- 6
include/core.sh View File

15
     #     debug -v var1 var2 result
15
     #     debug -v var1 var2 result
16
     #     debug -v "var@ result"
16
     #     debug -v "var@ result"
17
     #
17
     #
18
-    $FFOOD_DEBUG || return 0
18
+    $FFOO_DEBUG || return 0
19
     __echo "$@"
19
     __echo "$@"
20
 }
20
 }
21
 
21
 
64
     # Use "-l" to split every parameter to separate line, (useful
64
     # Use "-l" to split every parameter to separate line, (useful
65
     # or longer warnings)
65
     # or longer warnings)
66
     #
66
     #
67
-    $FFOOD_VERBOSE || return 0
67
+    $FFOO_VERBOSE || return 0
68
     __echo "$@"
68
     __echo "$@"
69
 }
69
 }
70
 
70
 
107
     #               that called __echo and each argument
107
     #               that called __echo and each argument
108
     #               given
108
     #               given
109
     #
109
     #
110
-    ffood import mkpretty_${FFOOD_MKPRETTY}
110
+    ffoo import mkpretty_${FFOO_MKPRETTY}
111
     local caller=${FUNCNAME[2]}
111
     local caller=${FUNCNAME[2]}
112
     local front=${FUNCNAME[1]}
112
     local front=${FUNCNAME[1]}
113
     case "$caller" in
113
     case "$caller" in
163
 }
163
 }
164
 
164
 
165
 __echo_trace() {
165
 __echo_trace() {
166
-    $FFOOD_DEBUG || return 0
166
+    $FFOO_DEBUG || return 0
167
     local -a tr=(${FUNCNAME[@]})
167
     local -a tr=(${FUNCNAME[@]})
168
     unset tr[0]; unset tr[1]; unset tr[2];
168
     unset tr[0]; unset tr[1]; unset tr[2];
169
     local tmp=$(echo "${tr[*]}" | tr '  ' '\n' | tac )
169
     local tmp=$(echo "${tr[*]}" | tr '  ' '\n' | tac )
315
                 cat $arg
315
                 cat $arg
316
             ;;
316
             ;;
317
         *)              # name given, find all its incarnations
317
         *)              # name given, find all its incarnations
318
-            debug -v FFOOD_INIPATH
319
-            echo "$FFOOD_INIPATH" \
318
+            debug -v FFOO_INIPATH
319
+            echo "$FFOO_INIPATH" \
320
               | tr ':' '\n' \
320
               | tr ':' '\n' \
321
               | while read trydir;
321
               | while read trydir;
322
                 do
322
                 do

+ 8
- 8
include/mkpretty_color.sh View File

1
 #!/bin/bash
1
 #!/bin/bash
2
 
2
 
3
-ffood import termcolors
3
+ffoo import termcolors
4
 
4
 
5
 mkpretty_debug() {
5
 mkpretty_debug() {
6
     while IFS= read line;
6
     while IFS= read line;
7
-    do echo -ne "${FFOOD_TERMCOLORS_LBLUE}debug:$caller:$FFOOD_TERMCOLORS_NONE"
7
+    do echo -ne "${FFOO_TERMCOLORS_LBLUE}debug:$caller:$FFOO_TERMCOLORS_NONE"
8
        echo "$line"; done
8
        echo "$line"; done
9
 }
9
 }
10
 
10
 
11
 mkpretty_die() {
11
 mkpretty_die() {
12
-    echo -ne "$FFOOD_TERMCOLORS_LRED"
12
+    echo -ne "$FFOO_TERMCOLORS_LRED"
13
     while IFS= read line;
13
     while IFS= read line;
14
     do echo "$line"; done
14
     do echo "$line"; done
15
-    echo -ne "$FFOOD_TERMCOLORS_NONE"
15
+    echo -ne "$FFOO_TERMCOLORS_NONE"
16
 }
16
 }
17
 
17
 
18
 mkpretty_usage_is() {
18
 mkpretty_usage_is() {
19
-    echo -ne "$FFOOD_TERMCOLORS_YELLOW"
19
+    echo -ne "$FFOO_TERMCOLORS_YELLOW"
20
     while IFS= read line;
20
     while IFS= read line;
21
     do echo -e "$line"; done
21
     do echo -e "$line"; done
22
-    echo -ne "$FFOOD_TERMCOLORS_NONE"
22
+    echo -ne "$FFOO_TERMCOLORS_NONE"
23
 }
23
 }
24
 
24
 
25
 mkpretty_think() {
25
 mkpretty_think() {
28
 }
28
 }
29
 
29
 
30
 mkpretty_warn() {
30
 mkpretty_warn() {
31
-    echo -ne "$FFOOD_TERMCOLORS_LRED"
31
+    echo -ne "$FFOO_TERMCOLORS_LRED"
32
     while IFS= read line;
32
     while IFS= read line;
33
     do echo "$line"; done
33
     do echo "$line"; done
34
-    echo -ne "$FFOOD_TERMCOLORS_NONE"
34
+    echo -ne "$FFOO_TERMCOLORS_NONE"
35
 }
35
 }

+ 4
- 4
include/proj_ol.sh View File

1
 #!/bin/bash
1
 #!/bin/bash
2
 
2
 
3
-ffood import core
4
-ffood import recon
5
-ffood import testing
6
-ffood import yummy
3
+ffoo import core
4
+ffoo import recon
5
+ffoo import testing
6
+ffoo import yummy
7
 
7
 
8
 
8
 
9
 OLCS_RUNHOW=$(iniread -s mk.run.how mk-ol.ini)
9
 OLCS_RUNHOW=$(iniread -s mk.run.how mk-ol.ini)

+ 1
- 1
include/recon.sh View File

1
 #!/bin/bash
1
 #!/bin/bash
2
 
2
 
3
-ffood import core
3
+ffoo import core
4
 
4
 
5
 
5
 
6
 age_of_leaf() {
6
 age_of_leaf() {

+ 2
- 2
include/sw.sh View File

1
 #!/bin/bash
1
 #!/bin/bash
2
 
2
 
3
-ffood import core
4
-ffood import yummy
3
+ffoo import core
4
+ffoo import yummy
5
 
5
 
6
 any_install() {
6
 any_install() {
7
     local tool pkg
7
     local tool pkg

+ 17
- 17
include/termcolors.sh View File

1
-FFOOD_TERMCOLORS_BLACK="\033[0;30m"
2
-FFOOD_TERMCOLORS_RED="\033[0;31m"
3
-FFOOD_TERMCOLORS_GREEN="\033[0;32m"
4
-FFOOD_TERMCOLORS_YELLOW="\033[0;33m"
5
-FFOOD_TERMCOLORS_BLUE="\033[0;34m"
6
-FFOOD_TERMCOLORS_MAGENTA="\033[0;35m"
7
-FFOOD_TERMCOLORS_CYAN="\033[0;36m"
8
-FFOOD_TERMCOLORS_WHITE="\033[0;37m"
9
-FFOOD_TERMCOLORS_LBLACK="\033[1;30m"
10
-FFOOD_TERMCOLORS_LRED="\033[1;31m"
11
-FFOOD_TERMCOLORS_LGREEN="\033[1;32m"
12
-FFOOD_TERMCOLORS_LYELLOW="\033[1;33m"
13
-FFOOD_TERMCOLORS_LBLUE="\033[1;34m"
14
-FFOOD_TERMCOLORS_LMAGENTA="\033[1;35m"
15
-FFOOD_TERMCOLORS_LCYAN="\033[1;36m"
16
-FFOOD_TERMCOLORS_LWHITE="\033[1;37m"
17
-FFOOD_TERMCOLORS_NONE="\033[1;0m"
1
+FFOO_TERMCOLORS_BLACK="\033[0;30m"
2
+FFOO_TERMCOLORS_RED="\033[0;31m"
3
+FFOO_TERMCOLORS_GREEN="\033[0;32m"
4
+FFOO_TERMCOLORS_YELLOW="\033[0;33m"
5
+FFOO_TERMCOLORS_BLUE="\033[0;34m"
6
+FFOO_TERMCOLORS_MAGENTA="\033[0;35m"
7
+FFOO_TERMCOLORS_CYAN="\033[0;36m"
8
+FFOO_TERMCOLORS_WHITE="\033[0;37m"
9
+FFOO_TERMCOLORS_LBLACK="\033[1;30m"
10
+FFOO_TERMCOLORS_LRED="\033[1;31m"
11
+FFOO_TERMCOLORS_LGREEN="\033[1;32m"
12
+FFOO_TERMCOLORS_LYELLOW="\033[1;33m"
13
+FFOO_TERMCOLORS_LBLUE="\033[1;34m"
14
+FFOO_TERMCOLORS_LMAGENTA="\033[1;35m"
15
+FFOO_TERMCOLORS_LCYAN="\033[1;36m"
16
+FFOO_TERMCOLORS_LWHITE="\033[1;37m"
17
+FFOO_TERMCOLORS_NONE="\033[1;0m"

+ 5
- 5
include/testing.sh View File

1
 #!/bin/bash
1
 #!/bin/bash
2
 
2
 
3
-ffood import core
3
+ffoo import core
4
 
4
 
5
 collect_artifacts() {
5
 collect_artifacts() {
6
     local aroot="$1"
6
     local aroot="$1"
7
     test -n "$aroot" || usagef "target_root"
7
     test -n "$aroot" || usagef "target_root"
8
-    test -f $FFOOD_TMP/artifact_list || return 0
8
+    test -f $FFOO_TMP/artifact_list || return 0
9
     local tgt
9
     local tgt
10
     think "collecting artifacts to $aroot"
10
     think "collecting artifacts to $aroot"
11
-    cat $FFOOD_TMP/artifact_list \
11
+    cat $FFOO_TMP/artifact_list \
12
         | while read path;
12
         | while read path;
13
           do
13
           do
14
               tgt=$aroot/$(dirname $path)
14
               tgt=$aroot/$(dirname $path)
18
 }
18
 }
19
 
19
 
20
 register_artifact() {
20
 register_artifact() {
21
-    test -n "$FFOOD_TMP" && FFOOD_TMP=$(mktemp -d)
22
-    local list=$FFOOD_TMP/artifact_list
21
+    test -n "$FFOO_TMP" && FFOO_TMP=$(mktemp -d)
22
+    local list=$FFOO_TMP/artifact_list
23
     local a
23
     local a
24
     for a in "$@";
24
     for a in "$@";
25
     do
25
     do

+ 1
- 1
include/www.sh View File

1
 #!/bin/bash
1
 #!/bin/bash
2
 
2
 
3
-ffood import core
3
+ffoo import core
4
 
4
 
5
 filter_exprs() {
5
 filter_exprs() {
6
     #
6
     #

+ 1
- 1
include/xorg.sh View File

1
 #!/bin/bash
1
 #!/bin/bash
2
 
2
 
3
-ffood import core
3
+ffoo import core
4
 
4
 
5
 clipln() {
5
 clipln() {
6
     xclip -o -selection primary 2>/dev/null
6
     xclip -o -selection primary 2>/dev/null

+ 2
- 2
notes/TODO.md View File

14
 *   `__echo` -- add --source, i.e. print source of a
14
 *   `__echo` -- add --source, i.e. print source of a
15
     particular function at runtime
15
     particular function at runtime
16
 
16
 
17
-*   fix up `ffood --list-*`, current implementation is
17
+*   fix up `ffoo --list-*`, current implementation is
18
     scratching right ear with left hand
18
     scratching right ear with left hand
19
 
19
 
20
-*   support conflict checking in `ffood`. i.e. for TI and the likes
20
+*   support conflict checking in `ffoo`. i.e. for TI and the likes
21
 
21
 
22
 *   doc - finish `ffdoc`, add first line to function lists
22
 *   doc - finish `ffdoc`, add first line to function lists
23
 
23
 

+ 14
- 14
setup/mk.sh View File

1
 #!/bin/bash
1
 #!/bin/bash
2
-# ffood - Fast Food - a Bash Library
2
+# ffoo - Fast Foo - a Bash Library
3
 # See LICENSE file for copyright and license details.
3
 # See LICENSE file for copyright and license details.
4
 
4
 
5
 tmp=$(mktemp)
5
 tmp=$(mktemp)
9
 
9
 
10
 bindir=${DESTDIR}${PREFIX}/bin
10
 bindir=${DESTDIR}${PREFIX}/bin
11
 mandir=${DESTDIR}${MANPREFIX}
11
 mandir=${DESTDIR}${MANPREFIX}
12
-docdir=${DESTDIR}${PREFIX}/share/doc/ffood
13
-shrdir=${DESTDIR}${PREFIX}/share/ffood
12
+docdir=${DESTDIR}${PREFIX}/share/doc/ffoo
13
+shrdir=${DESTDIR}${PREFIX}/share/ffoo
14
 
14
 
15
 list_of_bins() {
15
 list_of_bins() {
16
     echo bin/ffdoc
16
     echo bin/ffdoc
24
 
24
 
25
 list_of_docs() {
25
 list_of_docs() {
26
     echo doc/fff.1.md
26
     echo doc/fff.1.md
27
-    echo doc/ffood.3.md
27
+    echo doc/ffoo.3.md
28
 }
28
 }
29
 
29
 
30
 list_of_shrs() {
30
 list_of_shrs() {
31
-    echo ffood.sh
31
+    echo ffoo.sh
32
     echo include
32
     echo include
33
 }
33
 }
34
 
34
 
40
 }
40
 }
41
 
41
 
42
 dist() {
42
 dist() {
43
-    local dirname=ffood-${VERSION}
43
+    local dirname=ffoo-${VERSION}
44
     mkdir -p $dirname
44
     mkdir -p $dirname
45
     cp -R   bin \
45
     cp -R   bin \
46
             config.mk \
46
             config.mk \
47
             doc \
47
             doc \
48
             include \
48
             include \
49
             Makefile \
49
             Makefile \
50
-            ffood.sh.in \
50
+            ffoo.sh.in \
51
             README \
51
             README \
52
             LICENSE \
52
             LICENSE \
53
             setup \
53
             setup \
81
     test -f .autoclean && clean || :
81
     test -f .autoclean && clean || :
82
 }
82
 }
83
 
83
 
84
-ffood() {
84
+ffoo() {
85
     local srcpath dstpath
85
     local srcpath dstpath
86
     find -type f -name '*.in' \
86
     find -type f -name '*.in' \
87
         | while read srcpath;
87
         | while read srcpath;
88
           do
88
           do
89
               dstpath=${srcpath%.in}
89
               dstpath=${srcpath%.in}
90
-              perl -pe "s|__FFOOD_DIR__|$shrdir|;
90
+              perl -pe "s|__FFOO_DIR__|$shrdir|;
91
                         s|__VERSION__|$VERSION|;" < $srcpath > $dstpath
91
                         s|__VERSION__|$VERSION|;" < $srcpath > $dstpath
92
               echo $dstpath >> built.list
92
               echo $dstpath >> built.list
93
           done
93
           done
105
 
105
 
106
 uninstall() {
106
 uninstall() {
107
     list_of_installed_bins | xargs rm -f
107
     list_of_installed_bins | xargs rm -f
108
-    rm -rf $shrdir/ffood
109
-    rm -rf $docdir/ffood
108
+    rm -rf $shrdir/ffoo
109
+    rm -rf $docdir/ffoo
110
     rm -f $mandir/man1/fff.1
110
     rm -f $mandir/man1/fff.1
111
-    rm -f $mandir/man3/ffood.3
111
+    rm -f $mandir/man3/ffoo.3
112
 }
112
 }
113
 
113
 
114
 case $1 in
114
 case $1 in
115
-    clean|dist|install|install_manpages|manpages|ffood|uninstall)
115
+    clean|dist|install|install_manpages|manpages|ffoo|uninstall)
116
         $1
116
         $1
117
         ;;
117
         ;;
118
     test)
118
     test)
119
         run_test
119
         run_test
120
         ;;
120
         ;;
121
     *)
121
     *)
122
-        echo "usage: $(basename $0) clean|dist|install|ffood|test|uninstall" >&2
122
+        echo "usage: $(basename $0) clean|dist|install|ffoo|test|uninstall" >&2
123
 esac
123
 esac

+ 2
- 2
test/iniread.in View File

2
 
2
 
3
 . /usr/share/beakerlib/beakerlib.sh
3
 . /usr/share/beakerlib/beakerlib.sh
4
 
4
 
5
-. __FFOOD_DIR__/qecc.sh
6
-ffood import core
5
+. __FFOO_DIR__/ffoo.sh
6
+ffoo import core
7
 
7
 
8
 
8
 
9
 do_test() {
9
 do_test() {