]> arthur.barton.de Git - bup.git/commitdiff
features: show version number of the Python interpreter
authorAlexander Barton <alex@barton.de>
Sun, 2 Aug 2020 18:10:29 +0000 (20:10 +0200)
committerRob Browning <rlb@defaultvalue.org>
Sat, 15 Aug 2020 17:01:32 +0000 (12:01 -0500)
This can be handy for debiugging, especially if the interpreter used
(like /usr/bin/python3) is a symlink to the actual Python interpreter
(/usr/bin/python3.7) and/or doesn't include the "micro" version at all.

Signed-off-by: Alexander Barton <alex@barton.de>
Reviewed-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
Documentation/bup-features.md
lib/cmd/features-cmd.py

index 959905e78e750941ffd2eca1601ab89ccc873734..d458ff3b6bed71b8c147d93267939176ddd2f3f6 100644 (file)
@@ -13,16 +13,18 @@ bup features
 # DESCRIPTION
 
 `bup features` reports information about the current bup installation,
-for example, whether command line editing is supported by `bup ftp`,
-or POSIX ACLs can be saved and restored.
+for example, which version of the Python interpreter is used, whether command
+line editing is supported by `bup ftp`, or POSIX ACLs can be saved and
+restored.
 
 # EXAMPLES
 
     $ bup features
     bup 0.31~a7ff2d5b8c12b24b97858aad1251d28c18f8c1e1
     source a7ff2d5b8c12b24b97858aad1251d28c18f8c1e1 2020-07-05 14:54:06 -0500
-    Command line editing (e.g. bup ftp): yes
-    Saving and restoring POSIX ACLs: yes
+        Python: 3.7.3
+        Command line editing (e.g. bup ftp): yes
+        Saving and restoring POSIX ACLs: yes
     ....
 
 # SEE ALSO
index c0495351c47bbb27a8ff7668da9545c66a3adc6d..3a5911dff4442e93fdf787c93034b278bfd731f6 100755 (executable)
@@ -15,7 +15,7 @@ exec "$bup_python" "$0"
 # end of bup preamble
 
 from __future__ import absolute_import, print_function
-import os.path, sys
+import os.path, sys, platform
 
 sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/..']
 
@@ -43,6 +43,7 @@ have_readline = getattr(_helpers, 'readline', None)
 have_libacl = getattr(_helpers, 'read_acl', None)
 have_xattr = metadata.xattr
 
+out.write(b'    Python: %s\n' % platform.python_version().encode('ascii'))
 show_support(out, have_readline, b'Command line editing (e.g. bup ftp)')
 show_support(out, have_libacl, b'Saving and restoring POSIX ACLs')
 show_support(out, have_xattr, b'Saving and restoring extended attributes (xattrs)')