aboutsummaryrefslogtreecommitdiff
path: root/src/statistics
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/statistics
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/statistics')
-rw-r--r--src/statistics/Makefile.am6
-rw-r--r--src/statistics/test_gnunet_statistics.py.in2
2 files changed, 3 insertions, 5 deletions
diff --git a/src/statistics/Makefile.am b/src/statistics/Makefile.am
index 6d69d58d8..52f382156 100644
--- a/src/statistics/Makefile.am
+++ b/src/statistics/Makefile.am
@@ -84,15 +84,13 @@ check_SCRIPTS = \
84 test_gnunet_statistics.py 84 test_gnunet_statistics.py
85endif 85endif
86 86
87do_subst = $(SED) -e 's,[@]PYTHON[@],$(PYTHON),g'
88
89SUFFIXES = .py.in .py 87SUFFIXES = .py.in .py
90.py.in.py: 88.py.in.py:
91 $(do_subst) < $(srcdir)/$< > $@ 89 $(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)/$< > $@
92 chmod +x $@ 90 chmod +x $@
93 91
94test_gnunet_statistics.py: test_gnunet_statistics.py.in Makefile 92test_gnunet_statistics.py: test_gnunet_statistics.py.in Makefile
95 $(do_subst) < $(srcdir)/test_gnunet_statistics.py.in > test_gnunet_statistics.py 93 $(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)/test_gnunet_statistics.py.in > test_gnunet_statistics.py
96 chmod +x test_gnunet_statistics.py 94 chmod +x test_gnunet_statistics.py
97 95
98EXTRA_DIST = \ 96EXTRA_DIST = \
diff --git a/src/statistics/test_gnunet_statistics.py.in b/src/statistics/test_gnunet_statistics.py.in
index 3a13c24f3..ce277b13e 100644
--- a/src/statistics/test_gnunet_statistics.py.in
+++ b/src/statistics/test_gnunet_statistics.py.in
@@ -1,4 +1,4 @@
1#!@PYTHON@ 1#!@PYTHONEXE@
2 2
3import os 3import os
4import sys 4import sys