summaryrefslogtreecommitdiff
path: root/ftparchive/writer.cc
diff options
context:
space:
mode:
authorDavid Kalnischkies <kalnischkies@gmail.com>2010-03-26 22:38:50 +0100
committerDavid Kalnischkies <kalnischkies@gmail.com>2010-03-26 22:38:50 +0100
commit34f1d96cf5657b5e34cd9880dccfa2028fa16b13 (patch)
tree300bd83cccfc8872e99616826b0753e364450007 /ftparchive/writer.cc
parent4e794c509becfd7e2bddfddc1205dc81397a48bd (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.cc12
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;
}
/*}}}*/