[build-path-prefix-map-spec] 01/50:
Ximin Luo
infinity0 at debian.org
Fri Mar 10 15:17:17 UTC 2017
This is an automated email from the git hooks/post-receive script.
infinity0 pushed a commit to branch master
in repository build-path-prefix-map-spec.
commit 466f7459f405ade1ba75d70cec96924b28d9e1f4
Author: Ximin Luo <infinity0 at pwned.gg>
Date: Wed Jan 11 13:18:19 2017 +0100
---
newline.mk | 26 ++++++++++++++++++++++++++
newline.sh | 9 +++++++++
2 files changed, 35 insertions(+)
diff --git a/newline.mk b/newline.mk
new file mode 100644
index 0000000..dca190c
--- /dev/null
+++ b/newline.mk
@@ -0,0 +1,26 @@
+#!/usr/bin/make -f
+# The ugliest one, we can't use standard Makefile idioms because of the newline
+
+# Setting the variable
+
+ifdef SOURCE_PREFIX_MAP
+export override define SOURCE_PREFIX_MAP :=
+$(SOURCE_PREFIX_MAP)
+a=b
+endef
+else
+export override SOURCE_PREFIX_MAP := a=b
+endif
+
+# Alternative method that is slightly shorter but results in an extra empty first mapping
+#export override define SOURCE_PREFIX_MAP :=
+#$(SOURCE_PREFIX_MAP)
+#a=b
+#endef
+
+# Can't print of a Makefile variable containing newlines due to its special
+# treatment within recipes; we have to print it as a shell variable instead.
+print-SOURCE_PREFIX_MAP:
+ @echo "$$SOURCE_PREFIX_MAP"
+
+# We don't expect Makefiles to have to read or apply the variable.
diff --git a/newline.sh b/newline.sh
new file mode 100644
index 0000000..d2d1732
--- /dev/null
+++ b/newline.sh
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+# Setting the variable
+
+export SOURCE_PREFIX_MAP="${SOURCE_PREFIX_MAP:+$SOURCE_PREFIX_MAP
+}a=b"
+echo "$SOURCE_PREFIX_MAP"
+
+# We don't expect shell scripts to have to read or apply the variable.
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/build-path-prefix-map-spec.git
More information about the Reproducible-commits
mailing list