From 9c24493fabefe1a2549eaab81770dbe6f24916d9 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 26 Nov 2009 23:46:49 +0100 Subject: Add APT::FTPArchive::LongDescription to disable the inclusion of the LongDescriptions in the generated Packages file. --- doc/apt-ftparchive.1.xml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'doc/apt-ftparchive.1.xml') diff --git a/doc/apt-ftparchive.1.xml b/doc/apt-ftparchive.1.xml index d4d77c68e..d47df957a 100644 --- a/doc/apt-ftparchive.1.xml +++ b/doc/apt-ftparchive.1.xml @@ -15,7 +15,7 @@ &apt-email; &apt-product; - 29 February 2004 + 17 August 2009 @@ -543,7 +543,16 @@ for i in Sections do Make the caching databases read only. Configuration Item: APT::FTPArchive::ReadOnlyDB. - + + + + This configuration option defaults to "true" and should only be set to + "false" if the Archive generated with &apt-ftparchive; also provides + Translation files. Note that it is currently not possible to create these + files with apt-ftparchive. + + + &apt-commonoptions; -- cgit v1.2.3-70-g09d2 From ff574e76beb97c101924c2d4746b5a2dbb862f19 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sat, 28 Nov 2009 02:12:36 +0100 Subject: add APT::FTPArchive::AlwaysStat to disable the too aggressive caching if versions are build multiply times (not recommend) Patch by Christoph Goehre, thanks! (Closes: #463260) --- debian/changelog | 3 +++ doc/apt-ftparchive.1.xml | 12 ++++++++++++ doc/po/apt-doc.pot | 39 +++++++++++++++++++++++++++++---------- ftparchive/cachedb.cc | 14 +++++++++----- ftparchive/cachedb.h | 4 ++-- ftparchive/writer.cc | 5 +++-- ftparchive/writer.h | 1 + po/apt-all.pot | 24 ++++++++++++------------ 8 files changed, 71 insertions(+), 31 deletions(-) (limited to 'doc/apt-ftparchive.1.xml') diff --git a/debian/changelog b/debian/changelog index fdd7bd24b..85ee97713 100644 --- a/debian/changelog +++ b/debian/changelog @@ -80,6 +80,9 @@ apt (0.7.25) UNRELEASED; urgency=low - add https options which default to http ones (Closes: #557085) * ftparchive/writer.{cc,h}: - add APT::FTPArchive::LongDescription to be able to disable them + - add APT::FTPArchive::AlwaysStat to disable the too aggressive + caching if versions are build multiply times (not recommend) + Patch by Christoph Goehre, thanks! (Closes: #463260) * apt-pkg/deb/debsrcrecords.cc: - use "diff" filetype for .debian.tar.* files (Closes: #554898) diff --git a/doc/apt-ftparchive.1.xml b/doc/apt-ftparchive.1.xml index d47df957a..e2eab0fb2 100644 --- a/doc/apt-ftparchive.1.xml +++ b/doc/apt-ftparchive.1.xml @@ -544,6 +544,18 @@ for i in Sections do Configuration Item: APT::FTPArchive::ReadOnlyDB. + + + &apt-ftparchive; caches as much as possible of metadata in it is cachedb. If packages + are recompiled and/or republished with the same version again, this will lead to problems + as the now outdated cached metadata like size and checksums will be used. With this option + enabled this will no longer happen as it will be checked if the file was changed. + Note that this option is set to "false" by default as it is not recommend + to upload multiply versions/builds of a package with the same versionnumber, so in theory + nobody will have these problems and therefore all these extra checks are useless. + + + This configuration option defaults to "true" and should only be set to diff --git a/doc/po/apt-doc.pot b/doc/po/apt-doc.pot index 46febf8ca..5172f7f84 100644 --- a/doc/po/apt-doc.pot +++ b/doc/po/apt-doc.pot @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2009-11-27 00:18+0100\n" +"POT-Creation-Date: 2009-11-28 02:08+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -1411,7 +1411,7 @@ msgid "" msgstr "" #. type: Content of: -#: apt-cache.8.xml:356 apt-cdrom.8.xml:150 apt-config.8.xml:98 apt-extracttemplates.1.xml:67 apt-ftparchive.1.xml:556 apt-get.8.xml:554 apt-sortpkgs.1.xml:64 +#: apt-cache.8.xml:356 apt-cdrom.8.xml:150 apt-config.8.xml:98 apt-extracttemplates.1.xml:67 apt-ftparchive.1.xml:568 apt-get.8.xml:554 apt-sortpkgs.1.xml:64 msgid "&apt-commonoptions;" msgstr "" @@ -1426,7 +1426,7 @@ msgid "&file-sourceslist; &file-statelists;" msgstr "" #. type: Content of: -#: apt-cache.8.xml:368 apt-cdrom.8.xml:155 apt-config.8.xml:103 apt-extracttemplates.1.xml:74 apt-ftparchive.1.xml:572 apt-get.8.xml:569 apt-key.8.xml:162 apt-mark.8.xml:133 apt-secure.8.xml:181 apt-sortpkgs.1.xml:69 apt.conf.5.xml:1023 apt_preferences.5.xml:622 sources.list.5.xml:233 +#: apt-cache.8.xml:368 apt-cdrom.8.xml:155 apt-config.8.xml:103 apt-extracttemplates.1.xml:74 apt-ftparchive.1.xml:584 apt-get.8.xml:569 apt-key.8.xml:162 apt-mark.8.xml:133 apt-secure.8.xml:181 apt-sortpkgs.1.xml:69 apt.conf.5.xml:1023 apt_preferences.5.xml:622 sources.list.5.xml:233 msgid "See Also" msgstr "" @@ -1436,7 +1436,7 @@ msgid "&apt-conf;, &sources-list;, &apt-get;" msgstr "" #. type: Content of: <refentry><refsect1><title> -#: apt-cache.8.xml:373 apt-cdrom.8.xml:160 apt-config.8.xml:108 apt-extracttemplates.1.xml:78 apt-ftparchive.1.xml:576 apt-get.8.xml:575 apt-mark.8.xml:137 apt-sortpkgs.1.xml:73 +#: apt-cache.8.xml:373 apt-cdrom.8.xml:160 apt-config.8.xml:108 apt-extracttemplates.1.xml:78 apt-ftparchive.1.xml:588 apt-get.8.xml:575 apt-mark.8.xml:137 apt-sortpkgs.1.xml:73 msgid "Diagnostics" msgstr "" @@ -1735,7 +1735,7 @@ msgid "Just show the contents of the configuration space." msgstr "" #. type: Content of: <refentry><refsect1><para> -#: apt-config.8.xml:104 apt-extracttemplates.1.xml:75 apt-ftparchive.1.xml:573 apt-sortpkgs.1.xml:70 +#: apt-config.8.xml:104 apt-extracttemplates.1.xml:75 apt-ftparchive.1.xml:585 apt-sortpkgs.1.xml:70 msgid "&apt-conf;" msgstr "" @@ -2690,12 +2690,31 @@ msgstr "" #. type: Content of: <refentry><refsect1><variablelist><varlistentry><term> #: apt-ftparchive.1.xml:547 -msgid "<option>APT::FTPArchive::LongDescription</option>" +msgid "<option>APT::FTPArchive::AlwaysStat</option>" msgstr "" #. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para> #: apt-ftparchive.1.xml:549 msgid "" +"&apt-ftparchive; caches as much as possible of metadata in it is cachedb. If " +"packages are recompiled and/or republished with the same version again, this " +"will lead to problems as the now outdated cached metadata like size and " +"checksums will be used. With this option enabled this will no longer happen " +"as it will be checked if the file was changed. Note that this option is set " +"to \"<literal>false</literal>\" by default as it is not recommend to upload " +"multiply versions/builds of a package with the same versionnumber, so in " +"theory nobody will have these problems and therefore all these extra checks " +"are useless." +msgstr "" + +#. type: Content of: <refentry><refsect1><variablelist><varlistentry><term> +#: apt-ftparchive.1.xml:559 +msgid "<option>APT::FTPArchive::LongDescription</option>" +msgstr "" + +#. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para> +#: apt-ftparchive.1.xml:561 +msgid "" "This configuration option defaults to \"<literal>true</literal>\" and should " "only be set to <literal>\"false\"</literal> if the Archive generated with " "&apt-ftparchive; also provides <filename>Translation</filename> files. Note " @@ -2704,12 +2723,12 @@ msgid "" msgstr "" #. type: Content of: <refentry><refsect1><title> -#: apt-ftparchive.1.xml:561 apt.conf.5.xml:1011 apt_preferences.5.xml:462 sources.list.5.xml:193 +#: apt-ftparchive.1.xml:573 apt.conf.5.xml:1011 apt_preferences.5.xml:462 sources.list.5.xml:193 msgid "Examples" msgstr "" #. type: Content of: <refentry><refsect1><para><programlisting> -#: apt-ftparchive.1.xml:567 +#: apt-ftparchive.1.xml:579 #, no-wrap msgid "" "<command>apt-ftparchive</command> packages " @@ -2718,14 +2737,14 @@ msgid "" msgstr "" #. type: Content of: <refentry><refsect1><para> -#: apt-ftparchive.1.xml:563 +#: apt-ftparchive.1.xml:575 msgid "" "To create a compressed Packages file for a directory containing binary " "packages (.deb): <placeholder type=\"programlisting\" id=\"0\"/>" msgstr "" #. type: Content of: <refentry><refsect1><para> -#: apt-ftparchive.1.xml:577 +#: apt-ftparchive.1.xml:589 msgid "" "<command>apt-ftparchive</command> returns zero on normal operation, decimal " "100 on error." diff --git a/ftparchive/cachedb.cc b/ftparchive/cachedb.cc index dfda827b6..c352aa53c 100644 --- a/ftparchive/cachedb.cc +++ b/ftparchive/cachedb.cc @@ -102,9 +102,9 @@ bool CacheDB::OpenFile() // --------------------------------------------------------------------- /* This gets the size from the database if it's there. If we need * to look at the file, also get the mtime from the file. */ -bool CacheDB::GetFileStat() +bool CacheDB::GetFileStat(bool const &doStat) { - if ((CurStat.Flags & FlSize) == FlSize) + if ((CurStat.Flags & FlSize) == FlSize && doStat == false) { /* Already worked out the file size */ } @@ -162,7 +162,7 @@ bool CacheDB::GetCurStat() // --------------------------------------------------------------------- bool CacheDB::GetFileInfo(string FileName, bool DoControl, bool DoContents, bool GenContentsOnly, - bool DoMD5, bool DoSHA1, bool DoSHA256) + bool DoMD5, bool DoSHA1, bool DoSHA256, bool const &checkMtime) { this->FileName = FileName; @@ -171,14 +171,18 @@ bool CacheDB::GetFileInfo(string FileName, bool DoControl, bool DoContents, return false; } OldStat = CurStat; - - if (GetFileStat() == false) + + if (GetFileStat(checkMtime) == false) { delete Fd; Fd = NULL; return false; } + /* if mtime changed, update CurStat from disk */ + if (checkMtime == true && OldStat.mtime != CurStat.mtime) + CurStat.Flags = FlSize; + Stats.Bytes += CurStat.FileSize; Stats.Packages++; diff --git a/ftparchive/cachedb.h b/ftparchive/cachedb.h index c10f41ecc..15add459c 100644 --- a/ftparchive/cachedb.h +++ b/ftparchive/cachedb.h @@ -63,7 +63,7 @@ class CacheDB return true; } bool OpenFile(); - bool GetFileStat(); + bool GetFileStat(bool const &doStat = false); bool GetCurStat(); bool LoadControl(); bool LoadContents(bool GenOnly); @@ -125,7 +125,7 @@ class CacheDB bool SetFile(string FileName,struct stat St,FileFd *Fd); bool GetFileInfo(string FileName, bool DoControl, bool DoContents, - bool GenContentsOnly, bool DoMD5, bool DoSHA1, bool DoSHA256); + bool GenContentsOnly, bool DoMD5, bool DoSHA1, bool DoSHA256, bool const &checkMtime = false); bool Finish(); bool Clean(); diff --git a/ftparchive/writer.cc b/ftparchive/writer.cc index b2ebdca8a..6756021f8 100644 --- a/ftparchive/writer.cc +++ b/ftparchive/writer.cc @@ -306,6 +306,7 @@ PackagesWriter::PackagesWriter(string DB,string Overrides,string ExtOverrides, DoMD5 = _config->FindB("APT::FTPArchive::MD5",true); DoSHA1 = _config->FindB("APT::FTPArchive::SHA1",true); DoSHA256 = _config->FindB("APT::FTPArchive::SHA256",true); + DoAlwaysStat = _config->FindB("APT::FTPArchive::AlwaysStat", false); DoContents = _config->FindB("APT::FTPArchive::Contents",true); NoOverride = _config->FindB("APT::FTPArchive::NoOverrideMsg",false); LongDescription = _config->FindB("APT::FTPArchive::LongDescription",true); @@ -360,7 +361,7 @@ bool FTWScanner::SetExts(string Vals) bool PackagesWriter::DoPackage(string FileName) { // Pull all the data we need form the DB - if (Db.GetFileInfo(FileName, true, DoContents, true, DoMD5, DoSHA1, DoSHA256) + if (Db.GetFileInfo(FileName, true, DoContents, true, DoMD5, DoSHA1, DoSHA256, DoAlwaysStat) == false) { return false; @@ -753,7 +754,7 @@ ContentsWriter::ContentsWriter(string DB) : determine what the package name is. */ bool ContentsWriter::DoPackage(string FileName,string Package) { - if (!Db.GetFileInfo(FileName, Package.empty(), true, false, false, false, false)) + if (!Db.GetFileInfo(FileName, Package.empty(), true, false, false, false, false, false)) { return false; } diff --git a/ftparchive/writer.h b/ftparchive/writer.h index e76438900..8864461d5 100644 --- a/ftparchive/writer.h +++ b/ftparchive/writer.h @@ -84,6 +84,7 @@ class PackagesWriter : public FTWScanner bool DoMD5; bool DoSHA1; bool DoSHA256; + bool DoAlwaysStat; bool NoOverride; bool DoContents; bool LongDescription; diff --git a/po/apt-all.pot b/po/apt-all.pot index 3cb5ba379..b6610a191 100644 --- a/po/apt-all.pot +++ b/po/apt-all.pot @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-11-27 09:49+0100\n" +"POT-Creation-Date: 2009-11-28 02:10+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -357,11 +357,11 @@ msgstr "" msgid "Failed to stat %s" msgstr "" -#: ftparchive/cachedb.cc:238 +#: ftparchive/cachedb.cc:242 msgid "Archive has no control record" msgstr "" -#: ftparchive/cachedb.cc:444 +#: ftparchive/cachedb.cc:448 msgid "Unable to get a cursor" msgstr "" @@ -426,26 +426,26 @@ msgstr "" msgid " DeLink limit of %sB hit.\n" msgstr "" -#: ftparchive/writer.cc:388 +#: ftparchive/writer.cc:389 msgid "Archive had no package field" msgstr "" -#: ftparchive/writer.cc:396 ftparchive/writer.cc:627 +#: ftparchive/writer.cc:397 ftparchive/writer.cc:628 #, c-format msgid " %s has no override entry\n" msgstr "" -#: ftparchive/writer.cc:457 ftparchive/writer.cc:715 +#: ftparchive/writer.cc:458 ftparchive/writer.cc:716 #, c-format msgid " %s maintainer is %s not %s\n" msgstr "" -#: ftparchive/writer.cc:637 +#: ftparchive/writer.cc:638 #, c-format msgid " %s has no source override entry\n" msgstr "" -#: ftparchive/writer.cc:641 +#: ftparchive/writer.cc:642 #, c-format msgid " %s has no binary override entry either\n" msgstr "" @@ -1764,22 +1764,22 @@ msgstr "" msgid "Connecting to %s" msgstr "" -#: methods/connect.cc:165 methods/connect.cc:184 +#: methods/connect.cc:166 methods/connect.cc:185 #, c-format msgid "Could not resolve '%s'" msgstr "" -#: methods/connect.cc:190 +#: methods/connect.cc:191 #, c-format msgid "Temporary failure resolving '%s'" msgstr "" -#: methods/connect.cc:193 +#: methods/connect.cc:194 #, c-format msgid "Something wicked happened resolving '%s:%s' (%i - %s)" msgstr "" -#: methods/connect.cc:240 +#: methods/connect.cc:241 #, c-format msgid "Unable to connect to %s:%s:" msgstr "" -- cgit v1.2.3-70-g09d2 From c6474fb6ff482b0457674986a82afab0a3749af2 Mon Sep 17 00:00:00 2001 From: David Kalnischkies <kalnischkies@gmail.com> Date: Tue, 1 Dec 2009 00:28:26 +0100 Subject: fix a few typos in strings, comments and manpage of apt-ftparchive thanks Karl Goetz! (Closes: #558757) --- debian/changelog | 3 +++ doc/apt-ftparchive.1.xml | 2 +- ftparchive/apt-ftparchive.cc | 4 ++-- ftparchive/cachedb.cc | 6 +++--- ftparchive/contents.cc | 2 +- ftparchive/multicompress.cc | 2 +- ftparchive/writer.cc | 2 +- 7 files changed, 12 insertions(+), 9 deletions(-) (limited to 'doc/apt-ftparchive.1.xml') diff --git a/debian/changelog b/debian/changelog index 056e5c1f7..26b3e8c1e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -85,6 +85,9 @@ apt (0.7.25) UNRELEASED; urgency=low - add APT::FTPArchive::AlwaysStat to disable the too aggressive caching if versions are build multiply times (not recommend) Patch by Christoph Goehre, thanks! (Closes: #463260) + * ftparchive/*: + - fix a few typos in strings, comments and manpage, + thanks Karl Goetz! (Closes: #558757) * apt-pkg/deb/debsrcrecords.cc: - use "diff" filetype for .debian.tar.* files (Closes: #554898) * debian/apt.cron.daily: diff --git a/doc/apt-ftparchive.1.xml b/doc/apt-ftparchive.1.xml index e2eab0fb2..5d538c2c6 100644 --- a/doc/apt-ftparchive.1.xml +++ b/doc/apt-ftparchive.1.xml @@ -285,7 +285,7 @@ <varlistentry><term>Sources</term> <listitem><para> - Sets the output Packages file. Defaults to + Sets the output Sources file. Defaults to <filename>$(DIST)/$(SECTION)/source/Sources</filename></para></listitem> </varlistentry> diff --git a/ftparchive/apt-ftparchive.cc b/ftparchive/apt-ftparchive.cc index d0dea7768..5b6b3940c 100644 --- a/ftparchive/apt-ftparchive.cc +++ b/ftparchive/apt-ftparchive.cc @@ -3,7 +3,7 @@ // $Id: apt-ftparchive.cc,v 1.8.2.3 2004/01/02 22:01:48 mdz Exp $ /* ###################################################################### - apt-scanpackages - Efficient work-alike for dpkg-scanpackages + apt-ftparchive - Efficient work-alike for dpkg-scanpackages Let contents be disabled from the conf @@ -792,7 +792,7 @@ bool Generate(CommandLine &CmdL) if (_config->FindB("APT::FTPArchive::Contents",true) == false) return true; - c1out << "Done Packages, Starting contents." << endl; + c1out << "Packages done, Starting contents." << endl; // Sort the contents file list by date string ArchiveDir = Setup.FindDir("Dir::ArchiveDir"); diff --git a/ftparchive/cachedb.cc b/ftparchive/cachedb.cc index 64638459a..b04244347 100644 --- a/ftparchive/cachedb.cc +++ b/ftparchive/cachedb.cc @@ -69,7 +69,7 @@ bool CacheDB::ReadyDB(string const &DB) // apt 0.6.44 if (err == EINVAL) { - _error->Error(_("DB format is invalid. If you upgraded from a older version of apt, please remove and re-create the database.")); + _error->Error(_("DB format is invalid. If you upgraded from an older version of apt, please remove and re-create the database.")); } if (err) { @@ -83,7 +83,7 @@ bool CacheDB::ReadyDB(string const &DB) return true; } /*}}}*/ -// CacheDB::OpenFile - Open the filei /*{{{*/ +// CacheDB::OpenFile - Open the file /*{{{*/ // --------------------------------------------------------------------- /* */ bool CacheDB::OpenFile() @@ -139,7 +139,7 @@ bool CacheDB::GetCurStat() if (DBLoaded) { - /* First see if thre is anything about it + /* First see if there is anything about it in the database */ /* Get the flags (and mtime) */ diff --git a/ftparchive/contents.cc b/ftparchive/contents.cc index 693c36f9a..b761d9204 100644 --- a/ftparchive/contents.cc +++ b/ftparchive/contents.cc @@ -13,7 +13,7 @@ removing the massive sort time overhead. By breaking all the pathnames into components and storing them - separately a space savings is realized by not duplicating the string + separately a space saving is realized by not duplicating the string over and over again. Ultimately this saving is sacrificed to storage of the tree structure itself but the tree structure yields a speed gain in the sorting and processing. Ultimately it takes about 5 seconds to diff --git a/ftparchive/multicompress.cc b/ftparchive/multicompress.cc index 7c91d34fe..bb4beedf9 100644 --- a/ftparchive/multicompress.cc +++ b/ftparchive/multicompress.cc @@ -365,7 +365,7 @@ bool MultiCompress::CloseOld(int Fd,pid_t Proc) // MultiCompress::Child - The writer child /*{{{*/ // --------------------------------------------------------------------- /* The child process forks a bunch of compression children and takes - input on FD and passes it to all the compressor childer. On the way it + input on FD and passes it to all the compressor child. On the way it computes the MD5 of the raw data. After this the raw data in the original files is compared to see if this data is new. If the data is new then the temp files are renamed, otherwise they are erased. */ diff --git a/ftparchive/writer.cc b/ftparchive/writer.cc index bf6e9f617..5547c6aa5 100644 --- a/ftparchive/writer.cc +++ b/ftparchive/writer.cc @@ -464,7 +464,7 @@ bool PackagesWriter::DoPackage(string FileName) SetTFRewriteData(Changes[End++], "Maintainer", NewMaint.c_str()); /* Get rid of the Optional tag. This is an ugly, ugly, ugly hack that - dpkg-scanpackages does.. Well sort of. dpkg-scanpackages just does renaming + dpkg-scanpackages does. Well sort of. dpkg-scanpackages just does renaming but dpkg does this append bit. So we do the append bit, at least that way the status file and package file will remain similar. There are other transforms but optional is the only legacy one still in use for some lazy reason. */ -- cgit v1.2.3-70-g09d2