1#!/bin/sh
2"""": # -*-python-*-
3# https://sourceware.org/bugzilla/show_bug.cgi?id=26034
4export "BUP_ARGV_0"="$0"
5arg_i=1
6for arg in "$@"; do
7    export "BUP_ARGV_${arg_i}"="$arg"
8    shift
9    arg_i=$((arg_i + 1))
10done
11# Here to end of preamble replaced during install
12bup_python="$(dirname "$0")/../../config/bin/python" || exit $?
13exec "$bup_python" "$0"
14"""
15# end of bup preamble
16
17from __future__ import absolute_import, print_function
18import os.path, sys, platform
19
20sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/..']
21
22from bup import _helpers, compat, metadata, options, version
23from bup.io import byte_stream
24
25out = None
26
27def show_support(out, bool_opt, what):
28    out.write(b'    %s: %s\n' % (what, b'yes' if bool_opt else b'no'))
29
30optspec = """
31bup features
32"""
33o = options.Options(optspec)
34opt, flags, extra = o.parse(compat.argv[1:])
35
36sys.stdout.flush()
37out = byte_stream(sys.stdout)
38
39out.write(b'bup %s\n' % version.version)
40out.write(b'Source %s %s\n' % (version.commit, version.date))
41
42have_readline = getattr(_helpers, 'readline', None)
43have_libacl = getattr(_helpers, 'read_acl', None)
44have_xattr = metadata.xattr
45
46out.write(b'    Python: %s\n' % platform.python_version().encode('ascii'))
47show_support(out, have_readline, b'Command line editing (e.g. bup ftp)')
48show_support(out, have_libacl, b'Saving and restoring POSIX ACLs')
49show_support(out, have_xattr, b'Saving and restoring extended attributes (xattrs)')
50