build: Use if/then instead of `||` so that the `-e` flag works

master
Simon McVittie 2018-01-23 10:37:57 +00:00
parent 3aacac3b46
commit efcbeaa09a
2 changed files with 13 additions and 8 deletions

View File

@ -6,6 +6,7 @@ ikiwiki (3.20180106) UNRELEASED; urgency=medium
Discount >= 2.2.0 (Closes: #888055) Discount >= 2.2.0 (Closes: #888055)
* build: `set -e` before each `for` loop, so that errors are reliably * build: `set -e` before each `for` loop, so that errors are reliably
trapped trapped
* build: Use if/then instead of `||` so that the `-e` flag works
-- Simon McVittie <smcv@debian.org> Mon, 08 Jan 2018 10:51:10 +0000 -- Simon McVittie <smcv@debian.org> Mon, 08 Jan 2018 10:51:10 +0000

View File

@ -99,8 +99,9 @@ underlay_install:
for dir in `cd underlays && $(FIND) . -follow -type d`; do \ for dir in `cd underlays && $(FIND) . -follow -type d`; do \
install -d $(DESTDIR)$(PREFIX)/share/ikiwiki/$$dir; \ install -d $(DESTDIR)$(PREFIX)/share/ikiwiki/$$dir; \
for file in `$(FIND) underlays/$$dir -follow -maxdepth 1 -type f ! -name jquery.js ! -name jquery-ui.css ! -name jquery-ui.js ! -name jquery.tmpl.js`; do \ for file in `$(FIND) underlays/$$dir -follow -maxdepth 1 -type f ! -name jquery.js ! -name jquery-ui.css ! -name jquery-ui.js ! -name jquery.tmpl.js`; do \
cp -pRL $$file $(DESTDIR)$(PREFIX)/share/ikiwiki/$$dir 2>/dev/null || \ if ! cp -pRL $$file $(DESTDIR)$(PREFIX)/share/ikiwiki/$$dir 2>/dev/null; then \
install -m 644 $$file $(DESTDIR)$(PREFIX)/share/ikiwiki/$$dir; \ install -m 644 $$file $(DESTDIR)$(PREFIX)/share/ikiwiki/$$dir; \
fi; \
done; \ done; \
done done
@ -109,8 +110,9 @@ underlay_install:
set -e; \ set -e; \
for file in doc/ikiwiki/directive/*; do \ for file in doc/ikiwiki/directive/*; do \
if [ -f "$$file" ]; then \ if [ -f "$$file" ]; then \
cp -pRL $$file $(DESTDIR)$(PREFIX)/share/ikiwiki/directives/ikiwiki/directive 2>/dev/null || \ if ! cp -pRL $$file $(DESTDIR)$(PREFIX)/share/ikiwiki/directives/ikiwiki/directive 2>/dev/null; then \
install -m 644 $$file $(DESTDIR)$(PREFIX)/share/ikiwiki/directives/ikiwiki/directive; \ install -m 644 $$file $(DESTDIR)$(PREFIX)/share/ikiwiki/directives/ikiwiki/directive; \
fi; \
fi \ fi \
done done
@ -125,8 +127,9 @@ underlay_install:
elif echo "$$file" | grep -q base.css; then \ elif echo "$$file" | grep -q base.css; then \
:; \ :; \
elif [ -f "$$file" ]; then \ elif [ -f "$$file" ]; then \
cp -pRL $$file $(DESTDIR)$(PREFIX)/share/ikiwiki/$$file 2>/dev/null || \ if ! cp -pRL $$file $(DESTDIR)$(PREFIX)/share/ikiwiki/$$file 2>/dev/null; then \
install -m 644 $$file $(DESTDIR)$(PREFIX)/share/ikiwiki/$$file; \ install -m 644 $$file $(DESTDIR)$(PREFIX)/share/ikiwiki/$$file; \
fi; \
fi \ fi \
done; \ done; \
done done
@ -139,8 +142,9 @@ extra_install: underlay_install
done done
set -e; \ set -e; \
for file in `cd doc/examples; $(FIND) . -type f ! -regex '.*discussion.*'`; do \ for file in `cd doc/examples; $(FIND) . -type f ! -regex '.*discussion.*'`; do \
cp -pRL doc/examples/$$file $(DESTDIR)$(PREFIX)/share/ikiwiki/examples/$$file 2>/dev/null || \ if ! cp -pRL doc/examples/$$file $(DESTDIR)$(PREFIX)/share/ikiwiki/examples/$$file 2>/dev/null; then \
install -m 644 doc/examples/$$file $(DESTDIR)$(PREFIX)/share/ikiwiki/examples/$$file; \ install -m 644 doc/examples/$$file $(DESTDIR)$(PREFIX)/share/ikiwiki/examples/$$file; \
fi; \
done done
set -e; \ set -e; \