From 66905344357d03c206d99964a0d941b261f7146c Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 22 Mar 2010 18:25:37 +0100 Subject: * ftparchive/writer.cc: - write LongDescriptions if they shouldn't be included in Packages file into i18n/Translation-en by default. It is ensured that each package+description is listed only ones in the Translation file even if we generate multiple Packages file in one run. The file is only generated in "generate" - the simple file commands can't create it by now. Also, the LongDescription is currently a global setting, so generating archives with and without LongDescriptions in the Packages file in the same run are currently not possible. --- ftparchive/writer.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'ftparchive/writer.h') diff --git a/ftparchive/writer.h b/ftparchive/writer.h index af7ba4edd..2afd1af1f 100644 --- a/ftparchive/writer.h +++ b/ftparchive/writer.h @@ -19,6 +19,7 @@ #include #include #include +#include #include "cachedb.h" #include "override.h" @@ -72,6 +73,23 @@ class FTWScanner FTWScanner(string const &Arch = string()); }; +class TranslationWriter +{ + FILE *Output; + std::set Included; + unsigned short RefCounter; + + public: + void IncreaseRefCounter() { ++RefCounter; }; + unsigned short DecreaseRefCounter() { return (RefCounter == 0) ? 0 : --RefCounter; }; + unsigned short GetRefCounter() const { return RefCounter; }; + bool DoPackage(string const &Pkg, string const &Desc, string const &MD5); + + TranslationWriter(string const &File); + TranslationWriter() : Output(NULL), RefCounter(0) {}; + ~TranslationWriter(); +}; + class PackagesWriter : public FTWScanner { Override Over; @@ -93,6 +111,7 @@ class PackagesWriter : public FTWScanner string DirStrip; FILE *Output; struct CacheDB::Stats &Stats; + TranslationWriter *TransWriter; inline bool ReadOverride(string const &File) {return Over.ReadOverride(File);}; inline bool ReadExtraOverride(string const &File) -- cgit v1.2.3 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.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'ftparchive/writer.h') diff --git a/ftparchive/writer.h b/ftparchive/writer.h index 2afd1af1f..3123a7f46 100644 --- a/ftparchive/writer.h +++ b/ftparchive/writer.h @@ -22,6 +22,7 @@ #include #include "cachedb.h" +#include "multicompress.h" #include "override.h" #include "apt-ftparchive.h" @@ -75,6 +76,7 @@ class FTWScanner class TranslationWriter { + MultiCompress *Comp; FILE *Output; std::set Included; unsigned short RefCounter; @@ -85,8 +87,8 @@ class TranslationWriter unsigned short GetRefCounter() const { return RefCounter; }; bool DoPackage(string const &Pkg, string const &Desc, string const &MD5); - TranslationWriter(string const &File); - TranslationWriter() : Output(NULL), RefCounter(0) {}; + TranslationWriter(string const &File, string const &TransCompress, mode_t const &Permissions); + TranslationWriter() : Comp(NULL), Output(NULL), RefCounter(0) {}; ~TranslationWriter(); }; -- cgit v1.2.3 From f5cd2dbfc493127b18d9ea2b0bb258b736b91cd4 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sat, 29 May 2010 19:10:19 +0200 Subject: * ftparchive/writer.h: - add a virtual destructor to FTWScanner class (for cppcheck) --- ftparchive/writer.h | 1 + 1 file changed, 1 insertion(+) (limited to 'ftparchive/writer.h') diff --git a/ftparchive/writer.h b/ftparchive/writer.h index 3123a7f46..c08ddea85 100644 --- a/ftparchive/writer.h +++ b/ftparchive/writer.h @@ -72,6 +72,7 @@ class FTWScanner bool SetExts(string const &Vals); FTWScanner(string const &Arch = string()); + virtual ~FTWScanner(); }; class TranslationWriter -- cgit v1.2.3 From 4c265635a8417b857a3a8f537c74313d5533da9b Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 31 May 2010 12:58:20 +0200 Subject: =?UTF-8?q?i=20managed=20to=20commit=20broken=20code=E2=80=A6=20wh?= =?UTF-8?q?ich=20(at=20least=20in=20my=20mind)=20worked=20yesterday.=20Str?= =?UTF-8?q?ange=E2=80=A6=20anyway=20only=20small=20fixes.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ftparchive/writer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ftparchive/writer.h') diff --git a/ftparchive/writer.h b/ftparchive/writer.h index c08ddea85..49d430c47 100644 --- a/ftparchive/writer.h +++ b/ftparchive/writer.h @@ -72,7 +72,7 @@ class FTWScanner bool SetExts(string const &Vals); FTWScanner(string const &Arch = string()); - virtual ~FTWScanner(); + virtual ~FTWScanner() {}; }; class TranslationWriter -- cgit v1.2.3