From 34f1d96cf5657b5e34cd9880dccfa2028fa16b13 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Fri, 26 Mar 2010 22:38:50 +0100 Subject: 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. --- ftparchive/writer.cc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'ftparchive/writer.cc') 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; } /*}}}*/ -- cgit v1.2.3-70-g09d2