aboutsummaryrefslogtreecommitdiff
path: root/src/dht
diff options
context:
space:
mode:
authorng0 <ng0@n0.is>2019-12-02 15:30:56 +0000
committerng0 <ng0@n0.is>2019-12-02 15:30:56 +0000
commitc8e5e28048dd9605f7958ef95f2a6dd626658069 (patch)
tree52375a14cc93c4161a658b4c7a1926dda11d8909 /src/dht
parent53f35813d89de6f7c91883277129ffda3ca5b772 (diff)
downloadgnunet-c8e5e28048dd9605f7958ef95f2a6dd626658069.tar.gz
gnunet-c8e5e28048dd9605f7958ef95f2a6dd626658069.zip
rewrite sed logic used in Makefiles and move into dosubst awk script.
include 'bin' and its files in dist files, this is where dosubst is located. While the invocation (passing of the variables) is not optimal (yet, will be changed), this will in the end allow sharing code between Makefiles better, and maybe drop sed usage in the future.
Diffstat (limited to 'src/dht')
-rw-r--r--src/dht/Makefile.am8
-rw-r--r--src/dht/test_dht_tools.py.in4
2 files changed, 3 insertions, 9 deletions
diff --git a/src/dht/Makefile.am b/src/dht/Makefile.am
index bf73e8f19..2182d1c7f 100644
--- a/src/dht/Makefile.am
+++ b/src/dht/Makefile.am
@@ -220,13 +220,7 @@ check_SCRIPTS = \
220 test_dht_tools.py 220 test_dht_tools.py
221endif 221endif
222 222
223do_subst = $(SED) -e 's,[@]PYTHON[@],$(PYTHON),g' -e 's,[@]bindir[@],$(bindir),g'
224
225SUFFIXES = .py.in .py 223SUFFIXES = .py.in .py
226.py.in.py: 224.py.in.py:
227 $(do_subst) < $(srcdir)/$< > $@ 225 $(AWK) -v bdir="$(bindir)" -v py="$(PYTHON)" -v awkay="$(AWK_BINARY)" -v pfx="$(prefix)" -v prl="$(PERL)" -v sysconfdirectory="$(sysconfdir)" -v pkgdatadirectory="$(pkgdatadir)" -f $(top_srcdir)/bin/dosubst.awk < $(srcdir)/$< > $@
228 chmod +x $@ 226 chmod +x $@
229
230test_dht_tools.py: test_dht_tools.py.in Makefile
231 $(do_subst) < $(srcdir)/test_dht_tools.py.in > test_dht_tools.py
232 chmod +x test_dht_tools.py
diff --git a/src/dht/test_dht_tools.py.in b/src/dht/test_dht_tools.py.in
index c2f95e4b5..20739c45f 100644
--- a/src/dht/test_dht_tools.py.in
+++ b/src/dht/test_dht_tools.py.in
@@ -1,4 +1,4 @@
1#!@PYTHON@ 1#!@PYTHONEXE@
2# 2#
3# This testcase simply checks that the DHT command-line tools work. 3# This testcase simply checks that the DHT command-line tools work.
4# It launches a single peer, stores a value "testdata" under "testkey", 4# It launches a single peer, stores a value "testdata" under "testkey",
@@ -20,7 +20,7 @@ import subprocess
20import time 20import time
21import tempfile 21import tempfile
22 22
23os.environ["PATH"] = "@bindir@" + ":" + os.environ["PATH"] 23os.environ["PATH"] = "@bindirectory@" + ":" + os.environ["PATH"]
24 24
25if os.name == "nt": 25if os.name == "nt":
26 tmp = os.getenv("TEMP") 26 tmp = os.getenv("TEMP")