diff options
author | David Kalnischkies <kalnischkies@gmail.com> | 2010-03-26 22:38:50 +0100 |
---|---|---|
committer | David Kalnischkies <kalnischkies@gmail.com> | 2010-03-26 22:38:50 +0100 |
commit | 34f1d96cf5657b5e34cd9880dccfa2028fa16b13 (patch) | |
tree | 300bd83cccfc8872e99616826b0753e364450007 /ftparchive/writer.cc | |
parent | 4e794c509becfd7e2bddfddc1205dc81397a48bd (diff) |
Switch the TranslationWriter to use MultiCompress to be able to generate
the compressed files as we want them and to prevent the file to be
replaced without a reason which could save us from steady redownloads
of a file with the same content.
Diffstat (limited to 'ftparchive/writer.cc')
-rw-r--r-- | ftparchive/writer.cc | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/ftparchive/writer.cc b/ftparchive/writer.cc index b395903b7..45a8d212b 100644 --- a/ftparchive/writer.cc +++ b/ftparchive/writer.cc @@ -499,13 +499,15 @@ bool PackagesWriter::DoPackage(string FileName) // TranslationWriter::TranslationWriter - Constructor /*{{{*/ // --------------------------------------------------------------------- /* Create a Translation-Master file for this Packages file */ -TranslationWriter::TranslationWriter(string const &File) : Output(NULL), +TranslationWriter::TranslationWriter(string const &File, string const &TransCompress, + mode_t const &Permissions) : Output(NULL), RefCounter(0) { if (File.empty() == true) return; - Output = fopen(File.c_str(), "w"); + Comp = new MultiCompress(File, TransCompress, Permissions); + Output = Comp->Input; } /*}}}*/ // TranslationWriter::DoPackage - Process a single package /*{{{*/ @@ -536,8 +538,10 @@ bool TranslationWriter::DoPackage(string const &Pkg, string const &Desc, /* */ TranslationWriter::~TranslationWriter() { - if (Output != NULL) - fclose(Output); + if (Comp == NULL) + return; + + delete Comp; } /*}}}*/ |