summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
Diffstat (limited to 'build')
-rwxr-xr-xbuild30
1 files changed, 20 insertions, 10 deletions
diff --git a/build b/build
index 2668e0ea..381279c3 100755
--- a/build
+++ b/build
@@ -127,17 +127,27 @@ copy_file() {
}
update_readme() {
- ed README.md <<- EOF
-/Language packs
-+2kb
-/##
-'b,-2c
-$(echo -n "$OUTPUT" | sort)
-.
-w
-q
-EOF
+ local tf of
+ tf="$(mktemp)"
+ of="$(mktemp)"
+ sort <<<"$OUTPUT" | grep -vxE '[[:space:]]*' > "$of"
+ awk 'suppress == 0 {
+ gsub(/<!--Package Count-->[^<]*<!--\/Package Count-->/,
+ "<!--Package Count-->'"$(awk 'END {print NR}' "$of")"'<!--/Package Count-->");
+ print;
+ }
+ /<!--Language Packs-->/ {
+ suppress = 1;
+ while ( ( getline line < "'"$of"'" ) > 0 ) {
+ print line;
+ }
+ }
+ /<!--\/Language Packs-->/ {
+ suppress = 0;
+ print;
+ }' "README.md" >"$tf"
+ mv "$tf" "README.md"
}
PACKS="