]> arthur.barton.de Git - bup.git/commitdiff
Add bup-features to report status; drop ACL warnings
authorRob Browning <rlb@defaultvalue.org>
Sun, 19 Jul 2020 19:28:36 +0000 (14:28 -0500)
committerRob Browning <rlb@defaultvalue.org>
Sun, 19 Jul 2020 20:13:15 +0000 (15:13 -0500)
Add a new "bup features" command that reports information about the
status and capabilities of the current installation.

Given that, and the new summary at the end of the ./configure output,
drop the platform specific warnings, which were a bit odd anyway,
since they wouldn't warn you on say Linux if we found libacl, but it
didn't actually have all the features we required.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
Documentation/bup-features.md [new file with mode: 0644]
lib/bup/metadata.py
lib/cmd/features-cmd.py [new file with mode: 0755]
note/0.31

diff --git a/Documentation/bup-features.md b/Documentation/bup-features.md
new file mode 100644 (file)
index 0000000..959905e
--- /dev/null
@@ -0,0 +1,34 @@
+% bup-features(1) Bup %BUP_VERSION%
+% Rob Browning <rlb@defaultvalue.org>
+% %BUP_DATE%
+
+# NAME
+
+bup-features - report the current status and capabilities of bup itself
+
+# SYNOPSIS
+
+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.
+
+# 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
+    ....
+
+# SEE ALSO
+
+`bup-version`(1)
+
+# BUP
+
+Part of the `bup`(1) suite.
index eeec559e76ba37f453f7c43c13c58acf1f4f9e07..0a7514d4d78181c2c82fcb4f9adcd97a65820c96 100644 (file)
@@ -43,10 +43,6 @@ if sys.platform.startswith('linux'):
 try:
     from bup._helpers import read_acl, apply_acl
 except ImportError:
-    if not (sys.platform.startswith('cygwin') or
-            sys.platform.startswith('darwin') or
-            sys.platform.startswith('netbsd')):
-        log('Warning: POSIX ACL support missing; recompile with libacl1-dev/libacl-devel.\n')
     read_acl = apply_acl = None
 
 try:
diff --git a/lib/cmd/features-cmd.py b/lib/cmd/features-cmd.py
new file mode 100755 (executable)
index 0000000..c049535
--- /dev/null
@@ -0,0 +1,48 @@
+#!/bin/sh
+"""": # -*-python-*-
+# https://sourceware.org/bugzilla/show_bug.cgi?id=26034
+export "BUP_ARGV_0"="$0"
+arg_i=1
+for arg in "$@"; do
+    export "BUP_ARGV_${arg_i}"="$arg"
+    shift
+    arg_i=$((arg_i + 1))
+done
+# Here to end of preamble replaced during install
+bup_python="$(dirname "$0")/../../config/bin/python" || exit $?
+exec "$bup_python" "$0"
+"""
+# end of bup preamble
+
+from __future__ import absolute_import, print_function
+import os.path, sys
+
+sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/..']
+
+from bup import _helpers, compat, metadata, options, version
+from bup.io import byte_stream
+
+out = None
+
+def show_support(out, bool_opt, what):
+    out.write(b'    %s: %s\n' % (what, b'yes' if bool_opt else b'no'))
+
+optspec = """
+bup features
+"""
+o = options.Options(optspec)
+opt, flags, extra = o.parse(compat.argv[1:])
+
+sys.stdout.flush()
+out = byte_stream(sys.stdout)
+
+out.write(b'bup %s\n' % version.version)
+out.write(b'Source %s %s\n' % (version.commit, version.date))
+
+have_readline = getattr(_helpers, 'readline', None)
+have_libacl = getattr(_helpers, 'read_acl', None)
+have_xattr = metadata.xattr
+
+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)')
index debd3f0312146a9c59b9c6396925e7cb97499b06..db6e46046ee985b23cabf722578107f2d90e8415 100644 (file)
--- a/note/0.31
+++ b/note/0.31
@@ -4,6 +4,10 @@
 Notable changes in 0.31
 =======================
 
+* `bup features` has been added.  It reports information about bup
+  itself, including the current availability of features like readline
+  and support for POSIX ACLs.
+
 May require attention
 ---------------------