Ejemplo n.º 1
0
            after = []
        elif args.check:
            # no sorted section
            sys.exit(0)
        else:
            print("Error: %s" % (err, ), file=sys.stderr)
            sys.exit(1)

    try:
        input_entries = lib.parse_inside(index, inside, args.upstream)
    except exc.KSError as err:
        print("Error: %s" % (err, ), file=sys.stderr)
        sys.exit(1)

    try:
        sorted_entries = lib.series_sort(index, input_entries)
    except exc.KSError as err:
        print("Error: %s" % (err, ), file=sys.stderr)
        sys.exit(1)

    new_inside = lib.flatten([
        lib.series_header(inside),
        lib.series_format(sorted_entries),
        lib.series_footer(inside),
    ])

    to_update = list(filter(lib.tag_needs_update, input_entries))
    if args.check:
        result = 0
        if inside != new_inside:
            print("Input is not sorted.")
Ejemplo n.º 2
0
            print("Error: %s" % (err,), file=sys.stderr)
            sys.exit(1)
        if entry.dest_head != git_sort.oot:
            for rev in entry.revs:
                try:
                    match = current_revs[rev]
                except KeyError:
                    continue
                else:
                    print("Warning: commit %s in new patch \"%s\" is already "
                          "present in patch \"%s\" from series.conf." % (
                              rev[12:], entry.name, match,), file=sys.stderr)
        new_entries.append(entry)

    try:
        sorted_entries = lib.series_sort(index, current_entries + new_entries)
    except exc.KSError as err:
        print("Error: %s" % (err,), file=sys.stderr)
        sys.exit(1)

    cur_sorted_entries = collections.OrderedDict()
    for head, lines in list(sorted_entries.items()):
        current_lines = [line for line in lines if line not in new_lines]
        if current_lines:
            cur_sorted_entries[head] = current_lines

    cur_inside = lib.flatten([
        lib.series_header(inside),
        lib.series_format(cur_sorted_entries),
        lib.series_footer(inside),
    ])
Ejemplo n.º 3
0
            after = []
        elif args.check:
            # no sorted section
            sys.exit(0)
        else:
            print("Error: %s" % (err,), file=sys.stderr)
            sys.exit(1)

    try:
        input_entries = lib.parse_inside(index, inside, args.upstream)
    except exc.KSError as err:
        print("Error: %s" % (err,), file=sys.stderr)
        sys.exit(1)

    try:
        sorted_entries = lib.series_sort(index, input_entries)
    except exc.KSError as err:
        print("Error: %s" % (err,), file=sys.stderr)
        sys.exit(1)

    new_inside = lib.flatten([
        lib.series_header(inside),
        lib.series_format(sorted_entries),
        lib.series_footer(inside),
    ])

    to_update = list(filter(lib.tag_needs_update, input_entries))
    if args.check:
        result = 0
        if inside != new_inside:
            print("Input is not sorted.")
Ejemplo n.º 4
0
            print("Error: %s" % (err,), file=sys.stderr)
            sys.exit(1)
        if entry.dest_head != git_sort.oot:
            for rev in entry.revs:
                try:
                    match = current_revs[rev]
                except KeyError:
                    continue
                else:
                    print("Warning: commit %s in new patch \"%s\" is already "
                          "present in patch \"%s\" from series.conf." % (
                              rev[12:], entry.name, match,), file=sys.stderr)
        new_entries.append(entry)

    try:
        sorted_entries = lib.series_sort(index, current_entries + new_entries)
    except exc.KSError as err:
        print("Error: %s" % (err,), file=sys.stderr)
        sys.exit(1)

    cur_sorted_entries = collections.OrderedDict()
    for head, lines in list(sorted_entries.items()):
        current_lines = [line for line in lines if line not in new_lines]
        if current_lines:
            cur_sorted_entries[head] = current_lines

    cur_inside = lib.flatten([
        lib.series_header(inside),
        lib.series_format(cur_sorted_entries),
        lib.series_footer(inside),
    ])