summaryrefslogtreecommitdiffstats
path: root/cmd/dbufstat
diff options
context:
space:
mode:
authorArvind Sankar <[email protected]>2020-07-11 19:35:58 -0400
committerBrian Behlendorf <[email protected]>2020-07-14 17:33:44 -0700
commit38e2e9ce8327284b2d516874308300aa96102fe9 (patch)
tree0761f7f696e4da7888a0c99ffb3a91a63ecefdd4 /cmd/dbufstat
parentbdb518c13abb9eca8d6f8f1d9e2096dc5163a9e7 (diff)
Centralize variable substitution
A bunch of places need to edit files to incorporate the configured paths i.e. bindir, sbindir etc. Move this logic into a common file. Create arc_summary by copying arc_summary[23] as appropriate at build time instead of install time. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Arvind Sankar <[email protected]> Closes #10559
Diffstat (limited to 'cmd/dbufstat')
-rw-r--r--cmd/dbufstat/.gitignore1
-rw-r--r--cmd/dbufstat/Makefile.am16
-rwxr-xr-xcmd/dbufstat/dbufstat.in (renamed from cmd/dbufstat/dbufstat)2
3 files changed, 6 insertions, 13 deletions
diff --git a/cmd/dbufstat/.gitignore b/cmd/dbufstat/.gitignore
new file mode 100644
index 000000000..2c2e913ce
--- /dev/null
+++ b/cmd/dbufstat/.gitignore
@@ -0,0 +1 @@
+dbufstat
diff --git a/cmd/dbufstat/Makefile.am b/cmd/dbufstat/Makefile.am
index f3b7ed809..e672a01a4 100644
--- a/cmd/dbufstat/Makefile.am
+++ b/cmd/dbufstat/Makefile.am
@@ -1,13 +1,5 @@
-dist_bin_SCRIPTS = dbufstat
+include $(top_srcdir)/config/Substfiles.am
-#
-# The dbufstat script is compatible with both Python 2.6 and 3.4.
-# As such the python 3 shebang can be replaced at install time when
-# targeting a python 2 system. This allows us to maintain a single
-# version of the source.
-#
-if USING_PYTHON_2
-install-exec-hook:
- $(SED) ${ac_inplace} -e 's|^#!/usr/bin/env python3|#!/usr/bin/env python2|' \
- $(DESTDIR)$(bindir)/dbufstat
-endif
+bin_SCRIPTS = dbufstat
+
+SUBSTFILES += $(bin_SCRIPTS)
diff --git a/cmd/dbufstat/dbufstat b/cmd/dbufstat/dbufstat.in
index 4a57d8113..95749bd80 100755
--- a/cmd/dbufstat/dbufstat
+++ b/cmd/dbufstat/dbufstat.in
@@ -1,4 +1,4 @@
-#!/usr/bin/env python3
+#!/usr/bin/env @PYTHON_SHEBANG@
#
# Print out statistics for all cached dmu buffers. This information
# is available through the dbufs kstat and may be post-processed as