rpm-ostree/scripts/rpmostree-group2json.py
James Antill 855ab9ad01 compose: Add check-passwd/group JSON options, fails compose if uids/gids change
Verify uid/gid on files, directories and symlinks
Just output a msg when user/group is removed with no files

json-parsing: Add functions for strictly dealing with ints
passwd/json: Add simple scripts to convert passwd/group files to json data

docs: Check-passwd/groups and ignore-remove-users/groups JSON config. entries
2014-12-18 16:59:33 -05:00

21 lines
471 B
Python
Executable File

#! /usr/bin/python -tt
import os
import sys
out = """\
"check-groups": { "type": "data",\n\
"entries": { """
prefix_len = len(' "entries": { ')
done = False
for fname in sys.argv[1:]:
for line in open(fname):
(group,x,gid,x) = line.split(':', 3)
if done:
out += ',\n'
out += ' ' * prefix_len
done = True
out += '"%s": %s' % (group, gid)
out += ' } },'
print out