diff options
author | Alexey Neyman <stilor@att.net> | 2018-03-31 13:12:54 -0700 |
---|---|---|
committer | Alexey Neyman <stilor@att.net> | 2018-04-07 12:03:17 -0700 |
commit | 56d785bd006ab823caf39fc16e2ae6833ef2d780 (patch) | |
tree | 3ed15bae8f6157da10e99a09bda4ad65f32ff628 /maintainer/download-docs.sh | |
parent | d6f5c308f9b9564df548d7d6a245a56dbf5360bc (diff) | |
download | crosstool-ng-56d785bd006ab823caf39fc16e2ae6833ef2d780.tar.gz crosstool-ng-56d785bd006ab823caf39fc16e2ae6833ef2d780.tar.bz2 crosstool-ng-56d785bd006ab823caf39fc16e2ae6833ef2d780.zip |
Docs installation
- Move downloading the pages from a website to a separate script, invoke
as dist hook
- Install manpage
Signed-off-by: Alexey Neyman <stilor@att.net>
Diffstat (limited to 'maintainer/download-docs.sh')
-rwxr-xr-x | maintainer/download-docs.sh | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/maintainer/download-docs.sh b/maintainer/download-docs.sh new file mode 100755 index 00000000..5ef3c6ab --- /dev/null +++ b/maintainer/download-docs.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +distdir=${1:-.} + +# Configurable portions +docs_git=https://github.com/crosstool-ng/crosstool-ng.github.io.git +docs_subdir=_pages/docs + +# Clone a repository for docs. Github does not support 'git archive --remote='. +set -ex +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 + awk ' +BEGIN { skip=0; } + { + if ($0=="---") { + if (NR==1) { + skip=1 + next + } + else if (skip) { + skip=0 + next + } + } + if (!skip) { + print $0 + } + } +' < "${i}" > "${distdir}/docs/manual/${i##*/}" +done +rm -rf "${distdir}/site-docs" |