3 bup_python="$(dirname "$0")/../cmd/bup-python" || exit $?
4 exec "$bup_python" "$0" ${1+"$@"}
8 # Note: this currently relies on bup-python to handle arbitrary binary
11 from __future__ import absolute_import, print_function
18 print('Usage: id-other-than <--user|--group> ID [ID ...]',
29 except ValueError as e:
32 excluded_ids = set(int(x) for x in sys.argv[2:] if is_integer(x))
33 excluded_names = (x for x in sys.argv[2:] if not is_integer(x))
35 if sys.argv[1] == '--user':
36 for x in excluded_names:
37 excluded_ids.add(pwd.getpwnam(x).pw_uid)
38 for x in pwd.getpwall():
39 if x.pw_uid not in excluded_ids:
40 print(x.pw_name + ':' + str(x.pw_uid))
42 elif sys.argv[1] == '--group':
43 for x in excluded_names:
44 excluded_ids.add(grp.getgrnam(x).gr_gid)
45 for x in grp.getgrall():
46 if x.gr_gid not in excluded_ids:
47 print(x.gr_name + ':' + str(x.gr_gid))