瀏覽代碼

Get rid of "ini" notation

Alois Mahdal 10 年之前
父節點
當前提交
15f5538ed1
共有 8 個文件被更改,包括 34 次插入35 次删除
  1. 5
    6
      bin/saturnin.skel
  2. 0
    0
      libexec/saturnin-conf
  3. 5
    5
      libexec/saturnin-dmenu
  4. 11
    11
      libexec/saturnin-iam
  5. 2
    2
      libexec/saturnin-ln
  6. 6
    6
      libexec/saturnin-push
  7. 4
    4
      libexec/saturnin-revert
  8. 1
    1
      setup/mk.sh

+ 5
- 6
bin/saturnin.skel 查看文件

@@ -2,11 +2,11 @@
2 2
 
3 3
 . <(ffoom init)
4 4
 
5
-mkinipath() {
6
-    local userd="__SATURNIN_CONFIG_USER__/ini.d"
5
+mkconfpath() {
6
+    local userd="__SATURNIN_CONFIG_USER__/conf.d"
7 7
     local user="__SATURNIN_CONFIG_USER__"
8 8
     local lcal="__SATURNIN_CONFIG_LOCAL__"
9
-    local distd="__SATURNIN_SHARE__/ini.d"
9
+    local distd="__SATURNIN_SHARE__/conf.d"
10 10
     test -d "$userd" && find "$userd" -mindepth 1 -maxdepth 1 -type d
11 11
     echo "$user"
12 12
     echo "$lcal"
@@ -15,11 +15,10 @@ mkinipath() {
15 15
 
16 16
 export FFOO_PATH="__SATURNIN_SHARE__/ffoo"
17 17
 SATURNIN_LIBEXEC="__SATURNIN_LIBEXEC__"
18
-export FFOO_CONFIG_PATH=$(mkinipath | tr '\n' :)
19
-export FFOO_CONFIG_SUFFIX=".ini"
18
+export FFOO_CONFIG_PATH=$(mkconfpath | tr '\n' :)
20 19
 export SATURNIN_VERSION="__VERSION__"
21 20
 
22
-ffoo import exit
21
+ffoo import exits
23 22
 ffoo import core
24 23
 
25 24
 usage() {

libexec/saturnin-ini → libexec/saturnin-conf 查看文件


+ 5
- 5
libexec/saturnin-dmenu 查看文件

@@ -20,11 +20,11 @@ esac done
20 20
 
21 21
 test -n "$delim"        && maybe_split=do_split
22 22
 
23
-nb="$(saturnin ini -p style.color.nbg)"
24
-nf="$(saturnin ini -p style.color.nfg)"
25
-sb="$(saturnin ini -p style.color.sbg)"
26
-sf="$(saturnin ini -p style.color.sfg)"
27
-fn="$(saturnin ini -p style.font)"
23
+nb="$(saturnin conf -p style.color.nbg)"
24
+nf="$(saturnin conf -p style.color.nfg)"
25
+sb="$(saturnin conf -p style.color.sbg)"
26
+sf="$(saturnin conf -p style.color.sfg)"
27
+fn="$(saturnin conf -p style.font)"
28 28
 fn=${fn:--*-terminus-medium-r-*-*-16-*-*-*-*-*-*-*}
29 29
 
30 30
 debug -v nb nf sb sf fn

+ 11
- 11
libexec/saturnin-iam 查看文件

@@ -45,26 +45,26 @@ familiars_at() {
45 45
     # daemons specific to $1 location plus the rest
46 46
     #
47 47
     test -n "$1" || usagef "location"
48
-    saturnin ini -p iam.running.at.$1
49
-    saturnin ini -p iam.running.at.ANYPLACE
48
+    saturnin conf -p iam.running.at.$1
49
+    saturnin conf -p iam.running.at.ANYPLACE
50 50
 }
51 51
 
52 52
 where_i_am() {
53 53
     #
54 54
     # what is my physical location?
55 55
     #
56
-    if=$(saturnin ini -p iam.using.if)
56
+    if=$(saturnin conf -p iam.using.if)
57 57
     gwmac=$(arp | grep "^gateway\\>.*\\<$if\$" | tr ' ' '\n' | grep :)
58
-    saturnin ini -p iam.seeing.gw.$gwmac || echo OUT
58
+    saturnin conf -p iam.seeing.gw.$gwmac || echo OUT
59 59
 }
60 60
 
61 61
 start_familiar() {
62 62
     #
63
-    # start familiar as indicated by ini file (unless running)
63
+    # start familiar as indicated by conf file (unless running)
64 64
     #
65 65
     local f=$1
66 66
     pids_matching $f && return 0
67
-    local like=$(saturnin ini -p iam.starting.like.this.$f)
67
+    local like=$(saturnin conf -p iam.starting.like.this.$f)
68 68
     debug -v f like
69 69
     if test -n  "$like";
70 70
         then
@@ -75,10 +75,10 @@ start_familiar() {
75 75
 
76 76
 set_status() {
77 77
     #
78
-    # set public status $1 by command in ini file
78
+    # set public status $1 by command in conf file
79 79
     #
80 80
     local what=$1
81
-    saturnin ini -p iam.saying.like.this.$what | bash
81
+    saturnin conf -p iam.saying.like.this.$what | bash
82 82
 }
83 83
 
84 84
 sound_is_muted() {
@@ -137,8 +137,8 @@ i_am_bbl() {
137 137
     # changing language
138 138
     #
139 139
     local cur=$(setxkbmap -v | grep '^symbols: ' | cut -d+ -f2)
140
-    local all="$(saturnin ini    -p iam.typing.lang)"
141
-    local def="$(saturnin ini -1 -p iam.typing.lang)"
140
+    local all="$(saturnin conf    -p iam.typing.lang)"
141
+    local def="$(saturnin conf -1 -p iam.typing.lang)"
142 142
     local nxt=$(
143 143
         echo -e "$all\n$all" \
144 144
           | grep -m 1 -A 1 $cur \
@@ -154,7 +154,7 @@ i_am_bbldone() {
154 154
     #
155 155
     # changing language back to normal
156 156
     #
157
-    setxkbmap "$(saturnin ini -1 -p iam.typing.lang)"
157
+    setxkbmap "$(saturnin conf -1 -p iam.typing.lang)"
158 158
 }
159 159
 
160 160
 i_am_deaf() {

+ 2
- 2
libexec/saturnin-ln 查看文件

@@ -38,7 +38,7 @@ link() {
38 38
 }
39 39
 
40 40
 load() {
41
-    saturnin ini -p ln.dir.$1 | expand_tilde | debug_pipe out
41
+    saturnin conf -p ln.dir.$1 | expand_tilde | debug_pipe out
42 42
 }
43 43
 
44 44
 while true; do case $1 in
@@ -53,7 +53,7 @@ test -z "$prefix"               && prefix=$(load prefix)
53 53
 test -z "$target"               && target=$DEFAULT_TARGET
54 54
 
55 55
 case $prefix.$name in
56
-    .)          die "provide at least name or set prefix in ln.ini";;
56
+    .)          die "provide at least name or set prefix in ln.conf";;
57 57
     $prefix.)   name=$prefix;;
58 58
     .$name)     :;;
59 59
     *)          name=$prefix.$name;;

+ 6
- 6
libexec/saturnin-push 查看文件

@@ -5,7 +5,7 @@
5 5
 ffoo import core
6 6
 ffoo import recon
7 7
 
8
-ORDER="$(saturnin ini -p push.options.order)"
8
+ORDER="$(saturnin conf -p push.options.order)"
9 9
 
10 10
 usage() {
11 11
     usage_is "[-o|--order path:host|host:path] host..."
@@ -19,11 +19,11 @@ while true; do case $1 in
19 19
     *)              hosts="$1"; shift ;;
20 20
 esac done
21 21
 
22
-test -n "$hosts" || hosts=$(saturnin ini -s push.hosts | debug_pipe ini_hosts)
22
+test -n "$hosts" || hosts=$(saturnin conf -s push.hosts | debug_pipe ini_hosts)
23 23
 debug -v hosts
24 24
 
25 25
 test -n "$hosts" || die "no valid hosts to begin with"
26
-paths=$(saturnin ini -s push.paths)
26
+paths=$(saturnin conf -s push.paths)
27 27
 test -n "$paths" || die "no valid paths to begin with"
28 28
 
29 29
 think "Probing & sorting paths"
@@ -55,7 +55,7 @@ case "$ORDER" in
55 55
             do
56 56
                 if rsync -L -r --delete $path $host:
57 57
                 then
58
-                    think $(collapse_tilde <<<"$path") sent to $host
58
+                    think "$(collapse_tilde <<<"$path") sent to $host"
59 59
                 fi
60 60
             done
61 61
         done
@@ -68,7 +68,7 @@ case "$ORDER" in
68 68
             do
69 69
                 if rsync -L -r --delete $path $host:
70 70
                 then
71
-                    think $host got $path
71
+                    think "$host got $path"
72 72
                 fi
73 73
             done
74 74
         done
@@ -81,7 +81,7 @@ esac
81 81
 
82 82
 for host in $hosts;
83 83
 do
84
-    saturnin ini -s push.commands \
84
+    saturnin conf -s push.commands \
85 85
       | grep . \
86 86
       | while read cmd;
87 87
         do

+ 4
- 4
libexec/saturnin-revert 查看文件

@@ -41,12 +41,12 @@ domain="$1"
41 41
 snapshot="$2"
42 42
 
43 43
 test -z "$snapshot" && {
44
-    think "looking for $domain in revert.ini"
45
-    snapshot=$(saturnin ini -1 -p revert.to.snapshot.$domain)
44
+    think "looking for $domain in revert.conf"
45
+    snapshot=$(saturnin conf -1 -p revert.to.snapshot.$domain)
46 46
 }
47 47
 test -z "$snapshot" && {
48
-    think "looking for default snapshot name in revert.ini"
49
-    snapshot=$(saturnin ini -1 -p revert.to.snapshot._default_)
48
+    think "looking for default snapshot name in revert.conf"
49
+    snapshot=$(saturnin conf -1 -p revert.to.snapshot._default_)
50 50
 }
51 51
 test -z "$snapshot" && {
52 52
     die "could not determine snapshot for $domain"

+ 1
- 1
setup/mk.sh 查看文件

@@ -19,7 +19,7 @@ list_of_lexs() {
19 19
     echo libexec/saturnin-czrates
20 20
     echo libexec/saturnin-dmenu
21 21
     echo libexec/saturnin-iam
22
-    echo libexec/saturnin-ini
22
+    echo libexec/saturnin-conf
23 23
     echo libexec/saturnin-ip
24 24
     echo libexec/saturnin-ln
25 25
     echo libexec/saturnin-push