- 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)
Configuration Item: <literal>APT::FTPArchive::ReadOnlyDB</literal>.</para></listitem>
</varlistentry>
+ <varlistentry><term><option>APT::FTPArchive::AlwaysStat</option></term>
+ <listitem><para>
+ &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.
+ </para></listitem>
+ </varlistentry>
+
<varlistentry><term><option>APT::FTPArchive::LongDescription</option></term>
<listitem><para>
This configuration option defaults to "<literal>true</literal>" and should only be set to
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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
msgstr ""
#. type: Content of: <refentry><refsect1><variablelist>
-#: 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 ""
msgstr ""
#. type: Content of: <refentry><refsect1><title>
-#: 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 ""
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 ""
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 ""
#. 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 "
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 "
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."
// ---------------------------------------------------------------------
/* 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 */
}
// ---------------------------------------------------------------------
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;
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++;
return true;
}
bool OpenFile();
- bool GetFileStat();
+ bool GetFileStat(bool const &doStat = false);
bool GetCurStat();
bool LoadControl();
bool LoadContents(bool GenOnly);
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();
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);
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;
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;
}
bool DoMD5;
bool DoSHA1;
bool DoSHA256;
+ bool DoAlwaysStat;
bool NoOverride;
bool DoContents;
bool LongDescription;
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"
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 ""
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 ""
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 ""