Kaynağa Gözat

Add docstrings to mkit's functions

Alois Mahdal 9 yıl önce
ebeveyn
işleme
035aa8b343
1 değiştirilmiş dosya ile 21 ekleme ve 0 silme
  1. 21
    0
      mkit/include/common.sh

+ 21
- 0
mkit/include/common.sh Dosyayı Görüntüle

@@ -6,6 +6,9 @@ bailout() {
6 6
 }
7 7
 
8 8
 build1() {
9
+    #
10
+    # Process one skeleton
11
+    #
9 12
     local srcpath dstpath
10 13
     srcpath=$1
11 14
     dstpath=${srcpath%.skel}
@@ -22,6 +25,9 @@ build1() {
22 25
 }
23 26
 
24 27
 build() {
28
+    #
29
+    # Add meat to all skeletons
30
+    #
25 31
     local srcpath
26 32
     find -type f -name '*.skel' \
27 33
      | while read srcpath;
@@ -51,6 +57,9 @@ configure() {
51 57
 }
52 58
 
53 59
 die() {
60
+    #
61
+    # Exit with message and non-zero exit status
62
+    #
54 63
     echo "$@" >&2
55 64
     exit 4
56 65
 }
@@ -96,6 +105,9 @@ expand_includes() {
96 105
 }
97 106
 
98 107
 expand_groups() {
108
+    #
109
+    # Read path groups from paths.ini and expand to install params
110
+    #
99 111
     local group
100 112
     local mode
101 113
     cat "mkit/paths.ini" \
@@ -109,6 +121,9 @@ expand_groups() {
109 121
 }
110 122
 
111 123
 expand_paths() {
124
+    #
125
+    # For each path of group $1, print all install params
126
+    #
112 127
     local group=$1
113 128
     local mode=$2
114 129
     local root="$(get_root $group)"
@@ -135,6 +150,9 @@ expand_variables() {
135 150
 }
136 151
 
137 152
 get_root() {
153
+    #
154
+    # Find out target rooot for group $1
155
+    #
138 156
     local group="$1"
139 157
     local varname="${group^^*}_DIR"
140 158
     test -n "${!varname}" || die "missing in config.mk: $varname"
@@ -232,6 +250,9 @@ install() {
232 250
 }
233 251
 
234 252
 read_section() {
253
+    #
254
+    # Read one INI section
255
+    #
235 256
     local wnt=$1
236 257
     local ok=false
237 258
     grep '.' \