diff options
author | David Kalnischkies <kalnischkies@gmail.com> | 2013-08-18 23:27:24 +0200 |
---|---|---|
committer | David Kalnischkies <david@kalnischkies.de> | 2014-05-09 13:06:27 +0200 |
commit | 1262d35895c930f3fa49d7b4182cdd7a4a841f74 (patch) | |
tree | 3d9874d4d7768273af4ee0907eb36d79295ab257 /apt-pkg/srcrecords.h | |
parent | f4c3850ea335545e297504941dc8c7a8f1c83358 (diff) |
use 'best' hash for source authentication
Collect all hashes we can get from the source record and put them into a
HashStringList so that 'apt-get source' can use it instead of using
always the MD5sum.
We therefore also deprecate the MD5 struct member in favor of the list.
While at it, the parsing of the Files is enhanced so that records which
miss "Files" (aka MD5 checksums) are still searched for other checksums
as they include just as much data, just not with a nice and catchy name.
LP: 1098738
Diffstat (limited to 'apt-pkg/srcrecords.h')
-rw-r--r-- | apt-pkg/srcrecords.h | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/apt-pkg/srcrecords.h b/apt-pkg/srcrecords.h index 58a5e242f..69b3cfd99 100644 --- a/apt-pkg/srcrecords.h +++ b/apt-pkg/srcrecords.h @@ -14,6 +14,7 @@ #define PKGLIB_SRCRECORDS_H #include <apt-pkg/macros.h> +#include <apt-pkg/hashes.h> #include <string> #include <vector> @@ -29,16 +30,24 @@ class pkgSrcRecords { public: +#if __GNUC__ >= 4 + // ensure that con- & de-structor don't trigger this warning + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#endif // Describes a single file struct File { - std::string MD5Hash; - std::string Hash; - unsigned long Size; std::string Path; std::string Type; + unsigned long long Size; + HashStringList Hashes; + APT_DEPRECATED std::string MD5Hash; }; - +#if __GNUC__ >= 4 + #pragma GCC diagnostic pop +#endif + // Abstract parser for each source record class Parser { |