From: Torsten Werner Date: Sat, 26 Mar 2011 10:58:09 +0000 (+0100) Subject: Add PackagesFileWriter and SourcesFileWriter. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fade955380a8542b531cec82ff44a5cb905b0c1a;p=dak Add PackagesFileWriter and SourcesFileWriter. Signed-off-by: Torsten Werner --- diff --git a/daklib/filewriter.py b/daklib/filewriter.py index 31093f00..714531af 100755 --- a/daklib/filewriter.py +++ b/daklib/filewriter.py @@ -113,3 +113,36 @@ class SourceContentsFileWriter(BaseFileWriter): flags.update(keywords) template = "dists/%(suite)s/%(component)s/Contents-source" BaseFileWriter.__init__(self, template, **flags) + +class PackagesFileWriter(BaseFileWriter): + def __init__(self, **keywords): + ''' + The value of the keywords suite, component, debtype and architecture + are strings. Output files are gzip compressed only. + ''' + flags = { + 'uncompressed': False, + 'gzip': True, + 'bzip2': True + } + flags.update(keywords) + if flags['debtype'] == 'deb': + template = "dists/%(suite)s/%(component)s/binary-%(architecture)s/Packages" + else: # udeb + template = "dists/%(suite)s/%(component)s/debian-installer/binary-%(architecture)s/Packages" + BaseFileWriter.__init__(self, template, **flags) + +class SourcesFileWriter(BaseFileWriter): + def __init__(self, **keywords): + ''' + The value of the keywords suite and component are strings. Output + files are gzip compressed only. + ''' + flags = { + 'uncompressed': False, + 'gzip': True, + 'bzip2': True + } + flags.update(keywords) + template = "dists/%(suite)s/%(component)s/source/Sources" + BaseFileWriter.__init__(self, template, **flags)