summaryrefslogtreecommitdiff
path: root/maintainer
diff options
context:
space:
mode:
authorAlexey Neyman <stilor@att.net>2018-04-03 07:01:17 (GMT)
committerAlexey Neyman <stilor@att.net>2018-04-07 19:03:17 (GMT)
commitbb6c97551f7cfafea811367de0a6f382d9aec36b (patch)
tree15291810af95d2e19be89a14be669a532f69c31b /maintainer
parent56d785bd006ab823caf39fc16e2ae6833ef2d780 (diff)
User manual installation
... when running from a release tarball. Signed-off-by: Alexey Neyman <stilor@att.net>
Diffstat (limited to 'maintainer')
-rwxr-xr-xmaintainer/download-docs.sh30
1 files changed, 27 insertions, 3 deletions
diff --git a/maintainer/download-docs.sh b/maintainer/download-docs.sh
index 5ef3c6a..3514a57 100755
--- a/maintainer/download-docs.sh
+++ b/maintainer/download-docs.sh
@@ -1,6 +1,9 @@
#!/bin/bash
-distdir=${1:-.}
+# Usage:
+# download-docs.sh TOP-LEVEL-DIR MANUAL-FILES...
+distdir=${1}
+shift
# Configurable portions
docs_git=https://github.com/crosstool-ng/crosstool-ng.github.io.git
@@ -12,7 +15,16 @@ git clone --depth=1 "${docs_git}" "${distdir}/site-docs"
# Copy the docs instead of the MANUAL_ONLINE placeholder
mkdir -p "${distdir}/docs/manual"
-for i in "${distdir}/site-docs/${docs_subdir}/"*.md; do
+while [ -n "${1}" ]; do
+ case "${1}" in
+ docs/manual/*) ;;
+ *) echo "Expected file not in docs/manual/: $1" >&2; exit 1;;
+ esac
+ input="${distdir}/site-docs/${docs_subdir}/${1#docs/manual/}"
+ if [ ! -r "${input}" ]; then
+ echo "Not found: ${1}" >&2
+ exit 1
+ fi
awk '
BEGIN { skip=0; }
{
@@ -30,6 +42,18 @@ BEGIN { skip=0; }
print $0
}
}
-' < "${i}" > "${distdir}/docs/manual/${i##*/}"
+ ' < "${input}" > "${distdir}/${1}"
+ rm -f "${input}"
+ shift
+done
+extra_md_pages=false
+for i in "${distdir}/site-docs/${docs_subdir}/"*.md; do
+ if [ -r "${i}" ]; then
+ echo "Unpackaged page in the manual: ${i#${distdir}/site-docs/${docs_subdir}/}"
+ extra_md_files=true
+ fi
done
+if [ "${extra_md_files}" = "true" ]; then
+ exit 1
+fi
rm -rf "${distdir}/site-docs"