|
@@ -27,38 +27,12 @@ _build1_ftype() {
|
27
|
27
|
local ftype=$1 # file/builder type
|
28
|
28
|
case $ftype in
|
29
|
29
|
MKIT_COMMON) _expand_tokens "tokens" ;;
|
30
|
|
- markdown) _expand_includes | _expand_tokens "tokens" ;;
|
31
|
30
|
rpmstuff) _expand_tokens "tokens" "rpmstuff:tokens" ;;
|
32
|
31
|
debstuff) _expand_tokens "tokens" "debstuff:tokens" ;;
|
33
|
32
|
*) die "unknown file type: $ftype" ;;
|
34
|
33
|
esac
|
35
|
34
|
}
|
36
|
35
|
|
37
|
|
-_expand_includes() {
|
38
|
|
- #
|
39
|
|
- # Expand include directives
|
40
|
|
- #
|
41
|
|
- # Expand e.g. `<!-- include4: foo.sh -->` to include code of foo.sh
|
42
|
|
- #
|
43
|
|
- perl -we '
|
44
|
|
- use strict;
|
45
|
|
- my $text;
|
46
|
|
- while (<>) {
|
47
|
|
- chomp;
|
48
|
|
- if (m/<!-- include4: (\S+) -->/) {
|
49
|
|
- open my $fh, $1 or warn "cannot find: $1";
|
50
|
|
- my $text = do { local($/); <$fh> };
|
51
|
|
- close $fh;
|
52
|
|
- $text =~ s/^(.)/ $1/gm;
|
53
|
|
- chomp $text;
|
54
|
|
- print "$text\n";
|
55
|
|
- } else {
|
56
|
|
- print "$_\n";
|
57
|
|
- }
|
58
|
|
- }
|
59
|
|
- '
|
60
|
|
-}
|
61
|
|
-
|
62
|
36
|
_expand_tokens() {
|
63
|
37
|
#
|
64
|
38
|
# Read stdin, expanding tokens from sections $@
|
|
@@ -99,7 +73,6 @@ _guess_ftype() {
|
99
|
73
|
#
|
100
|
74
|
local dstpath=$1 # destination path
|
101
|
75
|
case $dstpath in
|
102
|
|
- *.md) echo markdown ;;
|
103
|
76
|
*) echo MKIT_COMMON ;;
|
104
|
77
|
esac
|
105
|
78
|
}
|
|
@@ -126,25 +99,6 @@ build() {
|
126
|
99
|
done
|
127
|
100
|
}
|
128
|
101
|
|
129
|
|
-build_manpages() {
|
130
|
|
- #
|
131
|
|
- # Build manpages using ronn
|
132
|
|
- #
|
133
|
|
- local manfile # each manual file listed in '[files:man]'
|
134
|
|
- local mdfile # each source markdown file
|
135
|
|
- if command -v ronn >/dev/null; then
|
136
|
|
- ini lskeys "files:man" \
|
137
|
|
- | while read -r manfile; do
|
138
|
|
- mdfile="$manfile.md"
|
139
|
|
- ronn -r "$mdfile"
|
140
|
|
- rec_built "$manfile"
|
141
|
|
- done
|
142
|
|
- else
|
143
|
|
- echo "ronn is not installed"
|
144
|
|
- return 1
|
145
|
|
- fi
|
146
|
|
-}
|
147
|
|
-
|
148
|
102
|
clean() {
|
149
|
103
|
#
|
150
|
104
|
# Clean up tree after building
|