From 687e367310f40973076cce912d3a6210baf87268 Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Thu, 06 Jun 2019 11:58:39 -0400 Subject: build: Replace install commands with $(INSTALL) function install is non-standard and awkward at best. Without the -t option, the destination is assumed to be a non-directory file, even when it isn't (e.g. when a trailing "/" is used). BusyBox install didn't get a -t option until version 1.23.0. --- diff --git a/build b/build index 55f53cf..631f2ee 100755 --- a/build +++ b/build @@ -10,6 +10,15 @@ tables = \ southamerica \ etcetera +INSTALL = set -e; \ + INSTALL() { \ + i=0; for d in "$${@}"; do : $$((i += 1)); done; \ + mkdir -pv "$${d}"; \ + for s in "$${@}"; do [ $$((i -= 1)) -eq 0 ] && break; \ + cp -v "$${s}" "$${d}"; \ + done; \ + }; INSTALL + nop: @: @@ -18,15 +27,15 @@ build: touch $@ install: build - install -D src/tzselect tzselect.data/usr/bin - install -D src/zdump zdump.data/usr/bin - install -D src/zic zic.data/usr/sbin - install -D src/tzfile.5 tzdata-doc.data/usr/share/man/man5 - install -D src/tzselect.8 tzdata-doc.data/usr/share/man/man8 - install -D src/zdump.8 tzdata-doc.data/usr/share/man/man8 - install -D src/zic.8 tzdata-doc.data/usr/share/man/man8 + $(INSTALL) src/tzselect tzselect.data/usr/bin + $(INSTALL) src/zdump zdump.data/usr/bin + $(INSTALL) src/zic zic.data/usr/sbin + $(INSTALL) src/tzfile.5 tzdata-doc.data/usr/share/man/man5 + $(INSTALL) src/tzselect.8 tzdata-doc.data/usr/share/man/man8 + $(INSTALL) src/zdump.8 tzdata-doc.data/usr/share/man/man8 + $(INSTALL) src/zic.8 tzdata-doc.data/usr/share/man/man8 # Install country and zone tables used by tzselect. - install -D src/*.tab tzdata.data/usr/share/zoneinfo + $(INSTALL) src/*.tab tzdata.data/usr/share/zoneinfo # Install the Factory zone and make it the default localtime. src/zic -d tzdata.data/usr/share/zoneinfo src/factory mkdir -p tzdata.data/etc -- cgit v0.9.1