Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tag: 20121227
Fetching contributors…

Cannot retrieve contributors at this time

executable file 34 lines (28 sloc) 0.968 kB
#! /usr/bin/env python2.6
# vi: expandtab ts=4 sw=4
#
# Takes a 'manifest' style file and outputs a sorted version, warning about
# any duplicates.
#
import os
import sys
files = {}
filename = 'manifest'
# if filename is passed as first argument, use that file instead
if len(sys.argv) >= 2 and os.path.isfile(sys.argv[1]):
filename = sys.argv[1]
for line in open(filename).readlines():
line = line.strip()
if len(line) == 0 or line[0] == '#':
continue
fields = line.split(' ')
if len(fields) < 2:
sys.stderr.write("WARNING: unexpected manifest line: '%s' (removing)\n" % line)
continue
if fields[1] in files and not (
# Don't warn about same directory with identical properties.
fields[0] == 'd' and files[fields[1]] == line):
sys.stderr.write("WARNING: duplicate entry for '%s'\n" % fields[1])
files[fields[1]] = line
for key in sorted(files):
print files[key].rstrip(' ')
Jump to Line
Something went wrong with that request. Please try again.