[systemd-devel] [RFC PATCH 2/3] systemd-analyze: use specified binary, add --version

Zbigniew Jędrzejewski-Szmek zbyszek at in.waw.pl
Sat Dec 22 01:09:23 PST 2012


This makes systemd-analyze behave consistently with the
rest of installed programs.
---
 Makefile.am                    |  2 ++
 configure.ac                   | 11 +++++++----
 src/analyze/systemd-analyze.in |  3 ++-
 3 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 7c12e40..3f3408d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -3849,6 +3849,8 @@ SED_PROCESS = \
 		-e 's, at QUOTACHECK\@,$(QUOTACHECK),g' \
 		-e 's, at SYSTEM_SYSVINIT_PATH\@,$(sysvinitdir),g' \
 		-e 's, at VARLOGDIR\@,$(varlogdir),g' \
+		-e 's, at PYTHON\@,$(PYTHON),g' \
+		-e 's, at PYTHON_BINARY\@,$(PYTHON_BINARY),g' \
 		< $< > $@
 
 units/%: units/%.in Makefile
diff --git a/configure.ac b/configure.ac
index d0003bb..2f8e4c6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -103,6 +103,8 @@ AS_IF([test "x$with_python" != "xno"], [
         AS_IF([test "$PYTHON" != :], [have_python=yes])
 ])
 AM_CONDITIONAL([HAVE_PYTHON], [test "$have_python" = "yes"])
+AC_PATH_PROG(PYTHON_BINARY, [$PYTHON], [$exec_prefix/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)
@@ -866,12 +868,14 @@ AC_MSG_RESULT([
         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}
+        man pages:               ${have_manpages}
+        gtk-doc:                 ${enable_gtk_doc}
+        Split /usr:              ${enable_split_usr}
 
         prefix:                  ${prefix}
         rootprefix:              ${with_rootprefix}
@@ -881,14 +885,13 @@ AC_MSG_RESULT([
         include_prefix:          ${INCLUDE_PREFIX}
         lib dir:                 ${libdir}
         rootlib dir:             ${with_rootlibdir}
+        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}
-        Split /usr:              ${enable_split_usr}
-        man pages:               ${have_manpages}
-        gtk-doc:                 ${enable_gtk_doc}
+        Python binary:           ${PYTHON_BINARY}
 
         CFLAGS:                  ${OUR_CFLAGS} ${CFLAGS}
         CPPLAGS:                 ${OUR_CPPFLAGS} ${CPPFLAGS}
diff --git a/src/analyze/systemd-analyze.in b/src/analyze/systemd-analyze.in
index 88699d6..77d17f7 100755
--- a/src/analyze/systemd-analyze.in
+++ b/src/analyze/systemd-analyze.in
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!@PYTHON_BINARY@
 
 import sys, os
 import argparse
@@ -267,6 +267,7 @@ def plot():
         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
-- 
1.8.1.rc0.194.gaf2e3a9



More information about the systemd-devel mailing list