summaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorRyan Moeller <[email protected]>2019-09-12 16:32:32 -0400
committerBrian Behlendorf <[email protected]>2019-09-12 13:32:32 -0700
commit4f342e45be19d0bb8e32f38664dc29a12092dfe9 (patch)
tree685ca60e63c7b977750249f326143cf305699203 /cmd
parentb01a6574aebbf50504db2c1b28de5a9d288be1a5 (diff)
Canonicalize Python shebangs
/usr/bin/env python3 is the suggested[1] shebang for Python in general (likewise for python2) and is conventional across platforms. This eases development on systems where python is not installed in /usr/bin (FreeBSD for example) and makes it possible to develop in virtual environments (venv) for isolating dependencies. Many packaging guidelines discourage the use of /usr/bin/env, but since this is the canonical way of writing shebangs in the Python community, many packaging scripts are already equipped to handle substituting the appropriate absolute path to python automatically. Some RPM package builders lacking brp-mangle-shebangs need a small fallback mechanism in the package spec to stamp the appropriate shebang on installed Python scripts. [1]: https://docs.python.org/3/using/unix.html?#miscellaneous Reviewed-by: Richard Laager <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: George Melikov <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #9314
Diffstat (limited to 'cmd')
-rwxr-xr-xcmd/arc_summary/arc_summary22
-rwxr-xr-xcmd/arc_summary/arc_summary32
-rw-r--r--cmd/arcstat/Makefile.am2
-rwxr-xr-xcmd/arcstat/arcstat2
-rw-r--r--cmd/dbufstat/Makefile.am2
-rwxr-xr-xcmd/dbufstat/dbufstat2
6 files changed, 6 insertions, 6 deletions
diff --git a/cmd/arc_summary/arc_summary2 b/cmd/arc_summary/arc_summary2
index 734fb708b..2946ee195 100755
--- a/cmd/arc_summary/arc_summary2
+++ b/cmd/arc_summary/arc_summary2
@@ -1,4 +1,4 @@
-#!/usr/bin/python2
+#!/usr/bin/env python2
#
# $Id: arc_summary.pl,v 388:e27800740aa2 2011-07-08 02:53:29Z jhell $
#
diff --git a/cmd/arc_summary/arc_summary3 b/cmd/arc_summary/arc_summary3
index ebdf83218..a32b2caee 100755
--- a/cmd/arc_summary/arc_summary3
+++ b/cmd/arc_summary/arc_summary3
@@ -1,4 +1,4 @@
-#!/usr/bin/python3
+#!/usr/bin/env python3
#
# Copyright (c) 2008 Ben Rockwood <[email protected]>,
# Copyright (c) 2010 Martin Matuska <[email protected]>,
diff --git a/cmd/arcstat/Makefile.am b/cmd/arcstat/Makefile.am
index 2d59faa9c..8166778a1 100644
--- a/cmd/arcstat/Makefile.am
+++ b/cmd/arcstat/Makefile.am
@@ -8,6 +8,6 @@ dist_bin_SCRIPTS = arcstat
#
if USING_PYTHON_2
install-exec-hook:
- sed --in-place 's|^#!/usr/bin/python3|#!/usr/bin/python2|' \
+ sed --in-place 's|^#!/usr/bin/env python3|#!/usr/bin/env python2|' \
$(DESTDIR)$(bindir)/arcstat
endif
diff --git a/cmd/arcstat/arcstat b/cmd/arcstat/arcstat
index 57a2d621f..003499928 100755
--- a/cmd/arcstat/arcstat
+++ b/cmd/arcstat/arcstat
@@ -1,4 +1,4 @@
-#!/usr/bin/python3
+#!/usr/bin/env python3
#
# Print out ZFS ARC Statistics exported via kstat(1)
# For a definition of fields, or usage, use arctstat.pl -v
diff --git a/cmd/dbufstat/Makefile.am b/cmd/dbufstat/Makefile.am
index 06923d38b..a3f0c6e50 100644
--- a/cmd/dbufstat/Makefile.am
+++ b/cmd/dbufstat/Makefile.am
@@ -8,6 +8,6 @@ dist_bin_SCRIPTS = dbufstat
#
if USING_PYTHON_2
install-exec-hook:
- sed --in-place 's|^#!/usr/bin/python3|#!/usr/bin/python2|' \
+ sed --in-place 's|^#!/usr/bin/env python3|#!/usr/bin/env python2|' \
$(DESTDIR)$(bindir)/dbufstat
endif
diff --git a/cmd/dbufstat/dbufstat b/cmd/dbufstat/dbufstat
index e6c947fbc..4a57d8113 100755
--- a/cmd/dbufstat/dbufstat
+++ b/cmd/dbufstat/dbufstat
@@ -1,4 +1,4 @@
-#!/usr/bin/python3
+#!/usr/bin/env python3
#
# Print out statistics for all cached dmu buffers. This information
# is available through the dbufs kstat and may be post-processed as