From b82fe9b393fbe80d2793ec2819bf3950ee57fddb Mon Sep 17 00:00:00 2001 From: Sean Finney Date: Mon, 2 Jun 2008 23:28:08 +0200 Subject: include new reprepro config for diffgz/dsc mirror --- reprepro/conf/diffsonly.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100755 reprepro/conf/diffsonly.py (limited to 'reprepro/conf/diffsonly.py') diff --git a/reprepro/conf/diffsonly.py b/reprepro/conf/diffsonly.py new file mode 100755 index 0000000..e40e1aa --- /dev/null +++ b/reprepro/conf/diffsonly.py @@ -0,0 +1,28 @@ +#!/usr/bin/python + +from debian_bundle import deb822 +from gzip import GzipFile +from fnmatch import fnmatch +import sys + +if __name__ == '__main__': + try: + (prog,src,dst) = sys.argv + except ValueError: + print "usage: program " + sys.exit(1) + + inf = sys.argv[1] + slist = deb822.Sources.iter_paragraphs(GzipFile(inf)) + outf = file(sys.argv[2], "w") + print "filtering %s for .diff.gz/.dsc files..."%(inf) + for ent in slist: + for k in ['Files','Checksums-Sha1','Checksums-Sha256']: + newfiles = [] + if ent.has_key(k): + for f in ent[k]: + if fnmatch(f['name'], '*.diff.gz') or fnmatch(f['name'], '*.dsc'): + newfiles.append(f) + ent[k] = newfiles + outf.write(str(ent)) + outf.write("\n") -- cgit v1.2.3