浏览代码

Add data-sampler target

Alois Mahdal 7 年前
父节点
当前提交
35762cc0ef
共有 3 个文件被更改,包括 38 次插入1 次删除
  1. 33
    0
      src/include/build.sh
  2. 1
    0
      src/include/mkit.sh
  3. 4
    1
      src/mkit.mk

+ 33
- 0
src/include/build.sh 查看文件

@@ -87,6 +87,39 @@ __qfs() {
87 87
     '
88 88
 }
89 89
 
90
+_mkit_data() {
91
+    #
92
+    # Build sampler showing all token values
93
+    #
94
+    local token
95
+    local section
96
+    local sections
97
+    sections=()
98
+    ini lskeys tokens | grep -q . && sections=(tokens)
99
+    sections+=( $(ini lssect | grep ':tokens$') )
100
+    {
101
+        echo "(builtin):"
102
+        echo "  x_MKIT_PROJ_NAME__ => '__MKIT_PROJ_NAME__'"
103
+        echo "  x_MKIT_PROJ_CODENAME__ => '__MKIT_PROJ_CODENAME__'"
104
+        echo "  x_MKIT_PROJ_LICENSE__ => '__MKIT_PROJ_LICENSE__'"
105
+        echo "  x_MKIT_PROJ_PKGNAME__ => '__MKIT_PROJ_PKGNAME__'"
106
+        echo "  x_MKIT_PROJ_TAGLINE__ => '__MKIT_PROJ_TAGLINE__'"
107
+        echo "  x_MKIT_PROJ_MAINTAINER__ => '__MKIT_PROJ_MAINTAINER__'"
108
+        echo "  x_MKIT_PROJ_VCS_BROWSER__ => '__MKIT_PROJ_VCS_BROWSER__'"
109
+        echo "  x_MKIT_PROJ_GIT_LASTHASH__ => '__MKIT_PROJ_GIT_LASTHASH__'"
110
+        echo "  x_MKIT_PROJ_VERSION__ => '__MKIT_PROJ_VERSION__'"
111
+        echo "  x_MKIT_SELF_VERSION__ => '__MKIT_SELF_VERSION__'"
112
+        for section in "${sections[@]}"; do
113
+            echo "$section:"
114
+            for token in $(ini lskeys "$section"); do
115
+                echo "  x${token:1} => '$token'"
116
+            done
117
+        done
118
+    } \
119
+      | __expand_tokens "MKIT_BUILTIN" "${sections[@]}" \
120
+      | sed '/^  x/ s|x|_|'
121
+}
122
+
90 123
 build() {
91 124
     #
92 125
     # Add meat to all skeletons

+ 1
- 0
src/include/mkit.sh 查看文件

@@ -34,6 +34,7 @@ __valid_targets() {
34 34
     #
35 35
     # List valid routes
36 36
     #
37
+    echo _mkit_data
37 38
     echo build
38 39
     echo clean
39 40
     echo debstuff

+ 4
- 1
src/mkit.mk 查看文件

@@ -5,6 +5,9 @@ export MKIT_DIR
5 5
 
6 6
 all: build
7 7
 
8
+_mkit_data:
9
+	@"$(MKIT_DIR)"/make _mkit_data
10
+
8 11
 build:
9 12
 	@"$(MKIT_DIR)"/make build
10 13
 
@@ -50,4 +53,4 @@ vbump_y:
50 53
 vbump_z:
51 54
 	@"$(MKIT_DIR)"/make vbump_z
52 55
 
53
-.PHONY: all clean dist rpmstuff install uninstall release release_x release_y release_z vbump vbump_x vbump_y vbump_z
56
+.PHONY: all _mkit_data clean dist rpmstuff install uninstall release release_x release_y release_z vbump vbump_x vbump_y vbump_z