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 <behlendorf1@llnl.gov>
Signed-off-by: Arvind Sankar <nivedita@alum.mit.edu>
Closes #10559
This commit is contained in:
Arvind Sankar
2020-07-11 19:35:58 -04:00
committed by Brian Behlendorf
parent bdb518c13a
commit 38e2e9ce83
38 changed files with 156 additions and 289 deletions
+1
View File
@@ -0,0 +1 @@
dbufstat
+4 -12
View File
@@ -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)
@@ -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