"Fossies" - the Fresh Open Source Software Archive

Member "bup-0.30/t/unknown-owner" (28 Sep 2019, 612 Bytes) of package /linux/privat/bup-0.30.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "unknown-owner": 0.29.3_vs_0.30.

    1 #!/bin/sh
    2 """": # -*-python-*-
    3 bup_python="$(dirname "$0")/../cmd/bup-python" || exit $?
    4 exec "$bup_python" "$0" ${1+"$@"}
    5 """
    6 # end of bup preamble
    7 
    8 from __future__ import absolute_import
    9 
   10 import grp
   11 import pwd
   12 import sys
   13 
   14 def usage():
   15     print >> sys.stderr, "Usage: unknown-owner (--user | --group)"
   16 
   17 if len(sys.argv) != 2:
   18     usage()
   19     sys.exit(1)
   20 
   21 if sys.argv[1] == '--user':
   22     max_name_len = max([len(x.pw_name) for x in pwd.getpwall()])
   23 elif sys.argv[1] == '--group':
   24     max_name_len = max([len(x.gr_name) for x in grp.getgrall()])
   25 else:
   26     usage()
   27     sys.exit(1)
   28 
   29 print 'x' * (max_name_len + 1)