Browse Source

Use eeini instead of ini.iniread directly

Avoids need to replace __EECC_INI__PATH
Alois Mahdal 10 years ago
parent
commit
6a8ddec5a0
7 changed files with 22 additions and 35 deletions
  1. 5
    8
      bin/eedmenu.in
  2. 1
    2
      bin/eeget.in
  3. 9
    11
      bin/eeiam.in
  4. 1
    3
      bin/eeln.in
  5. 4
    6
      bin/eepush.in
  6. 2
    4
      bin/eerevert.in
  7. 0
    1
      bin/eewatch.in

+ 5
- 8
bin/eedmenu.in View File

2
 
2
 
3
 . <(ffoom init)
3
 . <(ffoom init)
4
 ffoo import core
4
 ffoo import core
5
-ffoo import ini
6
-
7
-FFOO_INI_PATH="__EECC_INI_PATH__"
8
 
5
 
9
 usage() {
6
 usage() {
10
     usage_is "[-l|--lines NUM] [--split CHAR] ARGS..."
7
     usage_is "[-l|--lines NUM] [--split CHAR] ARGS..."
23
 
20
 
24
 test -n "$delim"        && maybe_split=do_split
21
 test -n "$delim"        && maybe_split=do_split
25
 
22
 
26
-nb="$(iniread -p style.color.nbg)"
27
-nf="$(iniread -p style.color.nfg)"
28
-sb="$(iniread -p style.color.sbg)"
29
-sf="$(iniread -p style.color.sfg)"
30
-fn="$(iniread -p style.font)"
23
+nb="$(eeini -p style.color.nbg)"
24
+nf="$(eeini -p style.color.nfg)"
25
+sb="$(eeini -p style.color.sbg)"
26
+sf="$(eeini -p style.color.sfg)"
27
+fn="$(eeini -p style.font)"
31
 fn=${fn:--*-terminus-medium-r-*-*-16-*-*-*-*-*-*-*}
28
 fn=${fn:--*-terminus-medium-r-*-*-16-*-*-*-*-*-*-*}
32
 
29
 
33
 debug -v nb nf sb sf fn
30
 debug -v nb nf sb sf fn

+ 1
- 2
bin/eeget.in View File

1
 #!/bin/bash
1
 #!/bin/bash
2
 
2
 
3
 . <(ffoom init)
3
 . <(ffoom init)
4
-FFOO_INI_PATH="__EECC_INI_PATH__"
5
 
4
 
6
 ffoo import core
5
 ffoo import core
7
 ffoo import ini
6
 ffoo import ini
21
     *)              nvrlist=$1;         shift;   break  ;;
20
     *)              nvrlist=$1;         shift;   break  ;;
22
 esac done
21
 esac done
23
 
22
 
24
-test -n "$brewroot" || brewroot=$(iniread -p get.brewroot)
23
+test -n "$brewroot" || brewroot=$(eeini -p get.brewroot)
25
 test -n "$brewroot" || die "specify '-b /path/to/brewroot or get.brewroot in get.ini"
24
 test -n "$brewroot" || die "specify '-b /path/to/brewroot or get.brewroot in get.ini"
26
 test -d "$brewroot" || die "cannot access brewroot: $brewroot"
25
 test -d "$brewroot" || die "cannot access brewroot: $brewroot"
27
 
26
 

+ 9
- 11
bin/eeiam.in View File

1
 #!/bin/bash
1
 #!/bin/bash
2
 
2
 
3
 . <(ffoom init)
3
 . <(ffoom init)
4
-FFOO_INI_PATH="__EECC_INI_PATH__"
5
 
4
 
6
 ffoo import core
5
 ffoo import core
7
-ffoo import ini
8
 ffoo import recon
6
 ffoo import recon
9
 
7
 
10
 
8
 
47
     # daemons specific to $1 location plus the rest
45
     # daemons specific to $1 location plus the rest
48
     #
46
     #
49
     test -n "$1" || usagef "location"
47
     test -n "$1" || usagef "location"
50
-    iniread -p iam.running.at.$1
51
-    iniread -p iam.running.at.ANYPLACE
48
+    eeini -p iam.running.at.$1
49
+    eeini -p iam.running.at.ANYPLACE
52
 }
50
 }
53
 
51
 
54
 where_i_am() {
52
 where_i_am() {
55
     #
53
     #
56
     # what is my physical location?
54
     # what is my physical location?
57
     #
55
     #
58
-    if=$(iniread -p iam.using.if)
56
+    if=$(eeini -p iam.using.if)
59
     gwmac=$(arp | grep "^gateway\\>.*\\<$if\$" | tr ' ' '\n' | grep :)
57
     gwmac=$(arp | grep "^gateway\\>.*\\<$if\$" | tr ' ' '\n' | grep :)
60
-    iniread -p iam.seeing.gw.$gwmac || echo OUT
58
+    eeini -p iam.seeing.gw.$gwmac || echo OUT
61
 }
59
 }
62
 
60
 
63
 start_familiar() {
61
 start_familiar() {
66
     #
64
     #
67
     local f=$1
65
     local f=$1
68
     pids_matching $f && return 0
66
     pids_matching $f && return 0
69
-    local like=$(iniread -p iam.starting.like.this.$f)
67
+    local like=$(eeini -p iam.starting.like.this.$f)
70
     debug -v f like
68
     debug -v f like
71
     if test -n  "$like";
69
     if test -n  "$like";
72
         then
70
         then
80
     # set public status $1 by command in ini file
78
     # set public status $1 by command in ini file
81
     #
79
     #
82
     local what=$1
80
     local what=$1
83
-    iniread -p iam.saying.like.this.$what | bash
81
+    eeini -p iam.saying.like.this.$what | bash
84
 }
82
 }
85
 
83
 
86
 sound_is_muted() {
84
 sound_is_muted() {
138
     # changing language
136
     # changing language
139
     #
137
     #
140
     local cur=$(setxkbmap -v | grep '^symbols: ' | cut -d+ -f2)
138
     local cur=$(setxkbmap -v | grep '^symbols: ' | cut -d+ -f2)
141
-    local all="$(iniread    -p iam.typing.lang)"
142
-    local def="$(iniread -1 -p iam.typing.lang)"
139
+    local all="$(eeini    -p iam.typing.lang)"
140
+    local def="$(eeini -1 -p iam.typing.lang)"
143
     local nxt=$(
141
     local nxt=$(
144
         echo -e "$all\n$all" \
142
         echo -e "$all\n$all" \
145
           | grep -m 1 -A 1 $cur \
143
           | grep -m 1 -A 1 $cur \
155
     #
153
     #
156
     # changing language back to normal
154
     # changing language back to normal
157
     #
155
     #
158
-    setxkbmap "$(iniread -1 -p iam.typing.lang)"
156
+    setxkbmap "$(eeini -1 -p iam.typing.lang)"
159
 }
157
 }
160
 
158
 
161
 i_am_deaf() {
159
 i_am_deaf() {

+ 1
- 3
bin/eeln.in View File

1
 #!/bin/bash
1
 #!/bin/bash
2
 
2
 
3
 . <(ffoom init)
3
 . <(ffoom init)
4
-FFOO_INI_PATH="__EECC_INI_PATH__"
5
 
4
 
6
 ffoo import core
5
 ffoo import core
7
-ffoo import ini
8
 
6
 
9
 DEFAULT_TARGET=$HOME
7
 DEFAULT_TARGET=$HOME
10
 TRY_RELPATH=true
8
 TRY_RELPATH=true
43
 }
41
 }
44
 
42
 
45
 load() {
43
 load() {
46
-    iniread -p ln.dir.$1 | expand_tilde | debug_pipe out
44
+    eeini -p ln.dir.$1 | expand_tilde | debug_pipe out
47
 }
45
 }
48
 
46
 
49
 while true; do case $1 in
47
 while true; do case $1 in

+ 4
- 6
bin/eepush.in View File

1
 #!/bin/bash
1
 #!/bin/bash
2
 
2
 
3
 . <(ffoom init)
3
 . <(ffoom init)
4
-FFOO_INI_PATH="__EECC_INI_PATH__"
5
 
4
 
6
 ffoo import core
5
 ffoo import core
7
-ffoo import ini
8
 ffoo import recon
6
 ffoo import recon
9
 
7
 
10
-ORDER="$(iniread -p push.options.order)"
8
+ORDER="$(eeini -p push.options.order)"
11
 
9
 
12
 while true; do case $1 in
10
 while true; do case $1 in
13
     -d|--debug)     FFOO_DEBUG=true;    shift;      ;;
11
     -d|--debug)     FFOO_DEBUG=true;    shift;      ;;
19
     *)              hosts="$1"; shift;              ;;
17
     *)              hosts="$1"; shift;              ;;
20
 esac done
18
 esac done
21
 
19
 
22
-test -n "$hosts" || hosts=$(iniread -s push.hosts | debug_pipe ini_hosts)
20
+test -n "$hosts" || hosts=$(eeini -s push.hosts | debug_pipe ini_hosts)
23
 debug -v hosts
21
 debug -v hosts
24
 
22
 
25
 test -n "$hosts" || die "no valid hosts to begin with"
23
 test -n "$hosts" || die "no valid hosts to begin with"
26
-paths=$(iniread -s push.paths)
24
+paths=$(eeini -s push.paths)
27
 test -n "$paths" || die "no valid paths to begin with"
25
 test -n "$paths" || die "no valid paths to begin with"
28
 
26
 
29
 think "Probing & sorting paths"
27
 think "Probing & sorting paths"
81
 
79
 
82
 for host in $hosts;
80
 for host in $hosts;
83
 do
81
 do
84
-    iniread -s push.commands \
82
+    eeini -s push.commands \
85
       | grep . \
83
       | grep . \
86
       | while read cmd;
84
       | while read cmd;
87
         do
85
         do

+ 2
- 4
bin/eerevert.in View File

1
 #!/bin/bash
1
 #!/bin/bash
2
 
2
 
3
 . <(ffoom init)
3
 . <(ffoom init)
4
-FFOO_INI_PATH="__EECC_INI_PATH__"
5
 
4
 
6
 ffoo import core
5
 ffoo import core
7
-ffoo import ini
8
 ffoo import recon
6
 ffoo import recon
9
 
7
 
10
 usage() {
8
 usage() {
54
 
52
 
55
 test -z "$snapshot" && {
53
 test -z "$snapshot" && {
56
     think "looking for $domain in revert.ini"
54
     think "looking for $domain in revert.ini"
57
-    snapshot=$(iniread -1 -p revert.to.snapshot.$domain)
55
+    snapshot=$(eeini -1 -p revert.to.snapshot.$domain)
58
 }
56
 }
59
 test -z "$snapshot" && {
57
 test -z "$snapshot" && {
60
     think "looking for default snapshot name in revert.ini"
58
     think "looking for default snapshot name in revert.ini"
61
-    snapshot=$(iniread -1 -p revert.to.snapshot._default_)
59
+    snapshot=$(eeini -1 -p revert.to.snapshot._default_)
62
 }
60
 }
63
 test -z "$snapshot" && {
61
 test -z "$snapshot" && {
64
     die "could not determine snapshot for $domain"
62
     die "could not determine snapshot for $domain"

+ 0
- 1
bin/eewatch.in View File

1
 #!/bin/bash
1
 #!/bin/bash
2
 
2
 
3
 . <(ffoom init)
3
 . <(ffoom init)
4
-FFOO_INI_PATH="__EECC_INI_PATH__"
5
 
4
 
6
 ffoo import core
5
 ffoo import core
7
 ffoo import recon
6
 ffoo import recon