Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4b10be26 authored by Joe Onorato's avatar Joe Onorato Committed by android-build-merger
Browse files

Merge "Add a print command to fs_config_generator.py" am: e1c81d74 am: 08d6dfe1

am: 34ac6c73

Change-Id: I8313d4c91eca5bd6e10ed08c1042063915d5976f
parents 4ef40ccc 34ac6c73
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
@@ -1294,6 +1294,28 @@ class GroupGen(PasswdGen):

        print "%s::%s:" % (logon, uid)

@generator('print')
class PrintGen(BaseGenerator):
    """Prints just the constants and values, separated by spaces, in an easy to
    parse format for use by other scripts.

    Each line is just the identifier and the value, separated by a space.
    """

    def add_opts(self, opt_group):
        opt_group.add_argument(
            'aid-header', help='An android_filesystem_config.h file.')

    def __call__(self, args):

        hdr_parser = AIDHeaderParser(args['aid-header'])
        aids = hdr_parser.aids

        aids.sort(key=lambda item: int(item.normalized_value))

        for aid in aids:
            print '%s %s' % (aid.identifier, aid.normalized_value)


def main():
    """Main entry point for execution."""