[PATCH] MAINTAINERS: fix alphabetic ordering

From: Uwe Kleine-KÃnig
Date: Wed Sep 10 2008 - 15:53:19 EST

This change was done using the following Python script:

#! /usr/bin/env python

import locale
import re
import sys
import tempfile

locale.setlocale(locale.LC_ALL, 'en_US.UTF-8')

re_start = re.compile('P:')
re_topic = re.compile('[0-9a-zA-Z][^:]')
# F is undefined but used
re_field = re.compile('[PMLWTSF]:')
re_empty = re.compile('\s*$')

prologue = True
current_topic = None
topic = dict()
fixed_maintainers = tempfile.TemporaryFile()

for line in open('MAINTAINERS'):
if prologue:
print >> fixed_maintainers, line,
mo = re_start.match(line)
if mo:
prologue = False


mo = re_topic.match(line)
if mo:
current_topic = line
if topic.has_key(current_topic):
topic[current_topic] = list()

elif current_topic is None:
# rest of prologue
print >> fixed_maintainers, line,


assert not current_topic is None

mo = re_field.match(line)
if mo:

mo = re_empty.match(line)
if not mo:
print >> sys.stderr, 'tralala', current_topic, repr(line)

first = True

the_rest = 'THE REST\n'
have_the_rest = False

# sort case insensitive
for t, body in sorted(topic.iteritems(), key=lambda i: i[0].upper()):
if t == the_rest:
have_the_rest = True

if first:
first = False
print >> fixed_maintainers

print >> fixed_maintainers, t,
for line in body:
print >> fixed_maintainers, line,

if have_the_rest:
print >> fixed_maintainers

print >> fixed_maintainers, the_rest,
for line in topic[the_rest]:
print >> fixed_maintainers, line,


maintainers = open('MAINTAINERS', 'w')
for line in fixed_maintainers:
print >> maintainers, line,

Signed-off-by: Uwe Kleine-KÃnig <ukleinek@xxxxxxxxxxxxxxxxxxxxxxxxxx>
MAINTAINERS | 1250 +++++++++++++++++++++++++++++-----------------------------
1 files changed, 625 insertions(+), 625 deletions(-)

I deleted the actual patch to save some bytes. To get the real patch
you have several possibilities:

a) look at http://modarm9.com/git/people/ukleinek/linux-2.6.git?a=commit;h=7f347bb1e138857fabc059b791cf50240fedd61f;
b) fetch/pull from the maintainers branch at

git://www.modarm9.com/gitsrc/pub/people/ukleinek/linux-2.6.git maintainers

; or
c) extract the script above and apply it

Note that a) and b) probably stop working in the future.

Best regards
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/