summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Letan <lthms@soap.coffee>2020-02-22 16:27:39 +0100
committerThomas Letan <lthms@soap.coffee>2020-02-22 16:28:39 +0100
commitf6bec1183c2ecaf58fc4e0ea291b55000692e23c (patch)
tree88b3ae64703a42359e607a3f331a9e9de1da1e69
parentUse `tangle-org.el' during bootstrap (diff)
Integrate `update-gitignore.sh' inside cleopatra
-rw-r--r--.gitignore1
-rw-r--r--Makefile4
-rwxr-xr-xscripts/update-gitignore.sh17
-rw-r--r--site/posts/meta/Bootstrap.org26
4 files changed, 27 insertions, 21 deletions
diff --git a/.gitignore b/.gitignore
index 622752c..33e93a9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -31,6 +31,7 @@ site/posts/ExtensibleTypeSafeErrorHandling.html
site/posts/MonadTransformers.html
site/style/main.css
bootstrap.mk
+scripts/update-gitignore.sh
coq.mk
org.mk
scripts/export-org.el
diff --git a/Makefile b/Makefile
index 7f3b148..51a78b3 100644
--- a/Makefile
+++ b/Makefile
@@ -14,12 +14,12 @@ init-log:
.PHONY: init-log default build
-GENFILES += bootstrap.mk
+GENFILES += bootstrap.mk scripts/update-gitignore.sh
GENSASS +=
include bootstrap.mk
-bootstrap.mk \
+bootstrap.mk scripts/update-gitignore.sh \
&: ${CLEODIR}/Bootstrap.org
@echo " tangle $<"
@${EMACS} $< ${TANGLE}
diff --git a/scripts/update-gitignore.sh b/scripts/update-gitignore.sh
deleted file mode 100755
index ef03d3b..0000000
--- a/scripts/update-gitignore.sh
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/bin/bash
-
-BEGIN_MARKER="# begin generated files"
-END_MARKER="# begin generated files"
-
-# remove the previous list of generated files to ignore
-sed -i -e "/${BEGIN_MARKER}/,/${END_MARKER}/d" .gitignore
-# remove trailing empty lines
-sed -i -e :a -e '/^\n*$/{$d;N;};/\n$/ba' .gitignore
-
-# output the list of files to ignore
-echo "" >> .gitignore
-echo ${BEGIN_MARKER} >> .gitignore
-for f in $@; do
- echo "${f}" >> .gitignore
-done
-echo ${END_MARKER} >> .gitignore
diff --git a/site/posts/meta/Bootstrap.org b/site/posts/meta/Bootstrap.org
index 7e78e37..751e10c 100644
--- a/site/posts/meta/Bootstrap.org
+++ b/site/posts/meta/Bootstrap.org
@@ -184,7 +184,7 @@ The twist is, we derive the rule to tangle ~bootstrap.mk~ using
~<<extends>>~.
#+BEGIN_SRC verbatim
-<<extends(IN="Bootstrap.org", MK="bootstrap.mk")>>
+<<extends(IN="Bootstrap.org", MK="bootstrap.mk", GF="scripts/update-gitignore.sh")>>
#+END_SRC
This means that modifying code block of ~<<extends>>~ is as “dangerous” as
@@ -195,7 +195,7 @@ For purpose of illustrations, here is the snippet generated by Babel from the
previous source block.
#+BEGIN_SRC makefile :tangle Makefile :noweb yes
-<<extends(IN="Bootstrap.org", MK="bootstrap.mk")>>
+<<extends(IN="Bootstrap.org", MK="bootstrap.mk", GF="scripts/update-gitignore.sh")>>
#+END_SRC
From now on, the bootstrap process is completed: further generation processes
@@ -242,7 +242,29 @@ build : ${CONTENTS} ${GENFILES}
@soupault
@echo " update .gitignore"
@scripts/update-gitignore.sh ${CONTENTS} ${GENFILES} ${GENSASS}
+#+END_SRC
+
+#+BEGIN_SRC bash :tangle scripts/update-gitignore.sh :tangle-mode (identity #o755)
+#!/bin/bash
+
+BEGIN_MARKER="# begin generated files"
+END_MARKER="# begin generated files"
+
+# remove the previous list of generated files to ignore
+sed -i -e "/${BEGIN_MARKER}/,/${END_MARKER}/d" .gitignore
+# remove trailing empty lines
+sed -i -e :a -e '/^\n*$/{$d;N;};/\n$/ba' .gitignore
+# output the list of files to ignore
+echo "" >> .gitignore
+echo ${BEGIN_MARKER} >> .gitignore
+for f in $@; do
+ echo "${f}" >> .gitignore
+done
+echo ${END_MARKER} >> .gitignore
+#+END_SRC
+
+#+BEGIN_SRC makefile :tangle bootstrap.mk
serve :
@echo " start a python server"
@cd build; python -m http.server 2>/dev/null