diff options
-rw-r--r-- | README | 7 | ||||
-rwxr-xr-x | reprepro/conf/diffsonly.py | 28 | ||||
-rw-r--r-- | reprepro/conf/updates | 2 |
3 files changed, 33 insertions, 4 deletions
@@ -17,9 +17,10 @@ something providing an httpd first, you need a partial source archive, with the .dsc, diff.gz, Release, and Sources.gz files available. there's a sample config in the subdir -./reprepro, if you don't have one handy. currently it just fetches a -few packages for testing, and it also needlessly fetches the orig.tar.gz -files too, just because i don't know reprepro very well. +./reprepro, if you don't have one handy. Using a devious little python +filter, it will fetch the dsc and diff.gz files from etch/lenny/sid without +fetching the rest of the debs/tarballs, which should keep the archive size +down a bit (though it should also work just fine on a normal archive too). so, you have your source archive available, and installed somewhere. next set up a web server, and configure it to serve up the "application" from 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 |