From fade955380a8542b531cec82ff44a5cb905b0c1a Mon Sep 17 00:00:00 2001 From: Torsten Werner Date: Sat, 26 Mar 2011 11:58:09 +0100 Subject: [PATCH] Add PackagesFileWriter and SourcesFileWriter. Signed-off-by: Torsten Werner --- daklib/filewriter.py | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) 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) -- 2.39.5