aboutsummaryrefslogtreecommitdiff
path: root/www
diff options
context:
space:
mode:
authorMichael Reed <michael@michaelreed.io>2017-07-10 21:22:00 -0400
committerMichael Reed <michael@michaelreed.io>2017-07-10 21:32:26 -0400
commitb26ba423d0384d682b7cd3f7f8f491a0c4094328 (patch)
tree2c8cb62bc48e02d2c09707436519d70147aa1b75 /www
parent33994555b10253359c135d326a5cd36813b1db08 (diff)
downloadlibrebootfr-b26ba423d0384d682b7cd3f7f8f491a0c4094328.tar.gz
librebootfr-b26ba423d0384d682b7cd3f7f8f491a0c4094328.zip
www/index.sh: Fix OpenBSD touch(1) incompatibility, take #2
When running index.sh on OpenBSD, the following error happens for each item in the news/ directory (output is from "bash -x"): + touch -d '4 Jun 2017' news/andrew-robbins-new-maintainer.md touch: out of range or illegal time specification: YYYY-MM-DDThh:mm:ss[.frac][Z] This is because OpenBSD's touch(1) requires that the "d" flag's argument be in ISO 8601 format, that is, "YYYY-MM-DDThh:mm:ss[.frac][Z]". This could have been dealt with by converting the article date (determined by "sed -n 3p $f | sed -e 's/^..//g'") to ISO 8601 format, then passing the date to touch(1). That would have required even more code, so was discarded as a possible solution. Instead, we solve this by keeping a MANIFEST file under news/, which is read to determine (a) which articles should be added to news/index.md, and (b) in which order. This avoids the need for touch(1) altogether, finally making the whole libreboot website build properly on OpenBSD. This also allows a minor simplification in the Makefile.
Diffstat (limited to 'www')
-rw-r--r--www/Makefile2
-rwxr-xr-xwww/index.sh4
-rw-r--r--www/news/MANIFEST5
3 files changed, 8 insertions, 3 deletions
diff --git a/www/Makefile b/www/Makefile
index 681e3067..bcf230b1 100644
--- a/www/Makefile
+++ b/www/Makefile
@@ -16,7 +16,7 @@
MD_MAIN != find -L . -name '*.md' -and ! -path '*/news/*'
HTML_MAIN = $(MD_MAIN:.md=.html)
-MD_NEWS != find -L news -name '*.md' -and ! -name index.md
+MD_NEWS != cat news/MANIFEST
HTML_NEWS = $(MD_NEWS:.md=.html)
diff --git a/www/index.sh b/www/index.sh
index 4d7d2292..618b8fc5 100755
--- a/www/index.sh
+++ b/www/index.sh
@@ -37,13 +37,13 @@ meta() {
# generate the index file
-FILES=$(ls -1 -t news/*.md | sed -e s-.*index.md-- -e s-.*presentation.md--)
+# MANIFEST determines the order of news articles in news/index.md
+FILES=$(cat news/MANIFEST)
cat news-list.md > news/index.md
for f in $FILES
do
- touch -d "$(sed -n 3p $f | sed -e 's/^..//g')" $f
meta >> news/index.md
done
diff --git a/www/news/MANIFEST b/www/news/MANIFEST
new file mode 100644
index 00000000..e5e34cf0
--- /dev/null
+++ b/www/news/MANIFEST
@@ -0,0 +1,5 @@
+news/new-mailing-lists.md
+news/andrew-robbins-new-maintainer.md
+news/formalised-structure.md
+news/proposal-rejoin-gnu.md
+news/unity.md