chiark / gitweb /
systemd-analyze: use specified binary, add --version
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sat, 22 Dec 2012 09:09:23 +0000 (10:09 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sat, 5 Jan 2013 03:20:35 +0000 (22:20 -0500)
Python binary used in the she-bang line in installed
scripts can be set with ./configure PYTHON_BINARY=...
Defaults to the same path as python used during compilation.

Adding --version makes systemd-analyze behave consistently with the
rest of installed programs.

The lines in ./configure output are reordered to keep all yes/no lines
separate.  I think that this makes the output clearer.

Makefile.am
configure.ac
src/analyze/systemd-analyze.in

index c5af8e8135a0a021a5c333b203178aec0c62c262..e81998d3b20261b09c9f7b7b6fb3a2f784615f23 100644 (file)
@@ -3803,6 +3803,8 @@ SED_PROCESS = \
                -e 's,@VARLOGDIR\@,$(varlogdir),g' \
                -e 's,@RC_LOCAL_SCRIPT_PATH_START\@,$(RC_LOCAL_SCRIPT_PATH_START),g' \
                -e 's,@RC_LOCAL_SCRIPT_PATH_STOP\@,$(RC_LOCAL_SCRIPT_PATH_STOP),g' \
                -e 's,@VARLOGDIR\@,$(varlogdir),g' \
                -e 's,@RC_LOCAL_SCRIPT_PATH_START\@,$(RC_LOCAL_SCRIPT_PATH_START),g' \
                -e 's,@RC_LOCAL_SCRIPT_PATH_STOP\@,$(RC_LOCAL_SCRIPT_PATH_STOP),g' \
+               -e 's,@PYTHON\@,$(PYTHON),g' \
+               -e 's,@PYTHON_BINARY\@,$(PYTHON_BINARY),g' \
                < $< > $@
 
 units/%: units/%.in Makefile
                < $< > $@
 
 units/%: units/%.in Makefile
index e6dffe62535044a9a384d92f1bcb069e5c8b86a3..b8ee626aeeea7d3c726ca795b437bd584b60a5f2 100644 (file)
@@ -102,7 +102,12 @@ AS_IF([test "x$with_python" != "xno"], [
         AM_PATH_PYTHON(,, [:])
         AS_IF([test "$PYTHON" != :], [have_python=yes])
 ])
         AM_PATH_PYTHON(,, [:])
         AS_IF([test "$PYTHON" != :], [have_python=yes])
 ])
-AM_CONDITIONAL([HAVE_PYTHON], [test "$have_python" = "yes"])
+AM_CONDITIONAL([HAVE_PYTHON], [test "x$have_python" = "xyes"])
+AS_IF([test "x$PYTHON_BINARY" = "x"],
+      [AS_IF([test "x$have_python" = "xyes"],
+             [PYTHON_BINARY="$PYTHON"],
+             [PYTHON_BINARY=/usr/bin/python])])
+AC_ARG_VAR(PYTHON_BINARY, [Python binary used to launch installed scripts])
 
 AS_IF([test "x$with_python" != "xno"], [
         AC_PATH_PROG(PYTHON_CONFIG, python${PYTHON_VERSION}-config)
 
 AS_IF([test "x$with_python" != "xno"], [
         AC_PATH_PROG(PYTHON_CONFIG, python${PYTHON_VERSION}-config)
@@ -803,9 +808,6 @@ AC_OUTPUT
 AC_MSG_RESULT([
         $PACKAGE_NAME $VERSION
 
 AC_MSG_RESULT([
         $PACKAGE_NAME $VERSION
 
-        SysV compatibility:      ${SYSTEM_SYSV_COMPAT}
-        SysV init scripts:       ${SYSTEM_SYSVINIT_PATH}
-        SysV rc?.d directories:  ${SYSTEM_SYSVRCND_PATH}
         libcryptsetup:           ${have_libcryptsetup}
         tcpwrap:                 ${have_tcpwrap}
         PAM:                     ${have_pam}
         libcryptsetup:           ${have_libcryptsetup}
         tcpwrap:                 ${have_tcpwrap}
         PAM:                     ${have_pam}
@@ -831,12 +833,15 @@ AC_MSG_RESULT([
         coredump:                ${have_coredump}
         kmod:                    ${have_kmod}
         blkid:                   ${have_blkid}
         coredump:                ${have_coredump}
         kmod:                    ${have_kmod}
         blkid:                   ${have_blkid}
-        firmware path:           ${FIRMWARE_PATH}
         gudev:                   ${enable_gudev}
         gintrospection:          ${enable_introspection}
         keymap:                  ${enable_keymap}
         Python:                  ${have_python}
         Python Headers:          ${have_python_devel}
         gudev:                   ${enable_gudev}
         gintrospection:          ${enable_introspection}
         keymap:                  ${enable_keymap}
         Python:                  ${have_python}
         Python Headers:          ${have_python_devel}
+        man pages:               ${have_manpages}
+        gtk-doc:                 ${enable_gtk_doc}
+        Split /usr:              ${enable_split_usr}
+        SysV compatibility:      ${SYSTEM_SYSV_COMPAT}
 
         prefix:                  ${prefix}
         rootprefix:              ${with_rootprefix}
 
         prefix:                  ${prefix}
         rootprefix:              ${with_rootprefix}
@@ -846,14 +851,16 @@ AC_MSG_RESULT([
         include_prefix:          ${INCLUDE_PREFIX}
         lib dir:                 ${libdir}
         rootlib dir:             ${with_rootlibdir}
         include_prefix:          ${INCLUDE_PREFIX}
         lib dir:                 ${libdir}
         rootlib dir:             ${with_rootlibdir}
+        SysV init scripts:       ${SYSTEM_SYSVINIT_PATH}
+        SysV rc?.d directories:  ${SYSTEM_SYSVRCND_PATH}
+        Build Python:            ${PYTHON}
+        Installation Python:     ${PYTHON_BINARY}
+        firmware path:           ${FIRMWARE_PATH}
         PAM modules dir:         ${with_pamlibdir}
         D-Bus policy dir:        ${with_dbuspolicydir}
         D-Bus session dir:       ${with_dbussessionservicedir}
         D-Bus system dir:        ${with_dbussystemservicedir}
         D-Bus interfaces dir:    ${with_dbusinterfacedir}
         PAM modules dir:         ${with_pamlibdir}
         D-Bus policy dir:        ${with_dbuspolicydir}
         D-Bus session dir:       ${with_dbussessionservicedir}
         D-Bus system dir:        ${with_dbussystemservicedir}
         D-Bus interfaces dir:    ${with_dbusinterfacedir}
-        Split /usr:              ${enable_split_usr}
-        man pages:               ${have_manpages}
-        gtk-doc:                 ${enable_gtk_doc}
         Extra start script:      ${RC_LOCAL_SCRIPT_PATH_START}
         Extra stop script:       ${RC_LOCAL_SCRIPT_PATH_STOP}
 
         Extra start script:      ${RC_LOCAL_SCRIPT_PATH_START}
         Extra stop script:       ${RC_LOCAL_SCRIPT_PATH_STOP}
 
index de602be24298aef551a587f5568ef68ca5452164..26a9f7b57f3c398f9b1b611d62e35e341b5a02c4 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!@PYTHON_BINARY@
 
 import sys, os
 import argparse
 
 import sys, os
 import argparse
@@ -282,6 +282,7 @@ def plot():
         surface.finish()
 
 parser = argparse.ArgumentParser(formatter_class=argparse.RawDescriptionHelpFormatter,
         surface.finish()
 
 parser = argparse.ArgumentParser(formatter_class=argparse.RawDescriptionHelpFormatter,
+                                 version='systemd-analyze @PACKAGE_VERSION@',
                                  description='Process systemd profiling information',
                                  epilog='''\
 time - print time spent in the kernel before reaching userspace
                                  description='Process systemd profiling information',
                                  epilog='''\
 time - print time spent in the kernel before reaching userspace