diff options
Diffstat (limited to 'reprepro')
-rwxr-xr-x | reprepro/conf/diffsonly.py | 28 | ||||
-rw-r--r-- | reprepro/conf/updates | 2 |
2 files changed, 29 insertions, 1 deletions
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 <src> <dst>" + 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") diff --git a/reprepro/conf/updates b/reprepro/conf/updates index 9cab2e3..023a28d 100644 --- a/reprepro/conf/updates +++ b/reprepro/conf/updates @@ -1,3 +1,3 @@ Name: debian Method: http://ftp.se.debian.org/debian -FilterFormula: package (== php5) | package (== libapache2-mod-auth-pam) | package (== dbconfig-common) +ListHook: diffsonly.py |