lkml.org 
[lkml]   [2008]   [Sep]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Subject[PATCH] MAINTAINERS: fix alphabetic ordering
Date
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

continue

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

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

continue

assert not current_topic is None

mo = re_field.match(line)
if mo:
topic[current_topic].append(line)

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

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
continue

if first:
first = False
else:
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,

fixed_maintainers.seek(0)

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

Signed-off-by: Uwe Kleine-König <ukleinek@informatik.uni-freiburg.de>
---
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
Uwe
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2008-09-10 21:55    [W:0.175 / U:0.184 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site