summaryrefslogtreecommitdiff
path: root/apt-pkg/acquire-item.h
diff options
context:
space:
mode:
authorDavid Kalnischkies <kalnischkies@gmail.com>2011-02-03 14:22:32 +0100
committerDavid Kalnischkies <kalnischkies@gmail.com>2011-02-03 14:22:32 +0100
commit3eb9e257855d83d0486d7a5fa7cc5e2edebb6aaa (patch)
tree4739355d87bcbf8f49fa634b692e48e4aee6746d /apt-pkg/acquire-item.h
parent7c748f4aa1bd47089672353fd1a401d1c5c94723 (diff)
parent875bcb3670c43bd4450e27934ba105611e534df0 (diff)
merge 'after squeeze release'-stuff
[ David Kalnischkies ] * apt-pkg/depcache.cc: - add SetCandidateRelease() to set a candidate version and the candidates of dependencies if needed to a specified release (Closes: #572709) * cmdline/apt-get.cc: - if --print-uris is used don't setup downloader as we don't need progress, lock nor the directories it would create otherwise - show dependencies of essential packages which are going to remove only if they cause the remove of this essential (Closes: #601961) - keep not installed garbage packages uninstalled instead of showing in the autoremove section and installing those (Closes: #604222) - change pkg/release behavior to use the new SetCandidateRelease so installing packages from experimental or backports is easier - really do not show packages in the extra section if they were requested on the commandline, e.g. with a modifier (Closes: #184730) * debian/control: - add Vcs-Browser now that loggerhead works again (Closes: #511168) - depend on debhelper 7 to raise compat level - depend on dpkg-dev (>= 1.15.8) to have c++ symbol mangling * apt-pkg/contrib/fileutl.cc: - add a RealFileExists method and check that your configuration files are real files to avoid endless loops if not (Closes: #604401) - ignore non-regular files in GetListOfFilesInDir (Closes: #594694) * apt-pkg/contrib/weakptr.h: - include stddefs.h to fix compile error (undefined NULL) with gcc-4.6 * methods/https.cc: - fix CURLOPT_SSL_VERIFYHOST by really passing 2 to it if enabled * deb/dpkgpm.cc: - fix popen/fclose mismatch reported by cppcheck. Thanks to Petter Reinholdtsen for report and patch! (Closes: #607803) * doc/apt.conf.5.xml: - fix multipl{y,e} spelling error reported by Jakub Wilk (Closes: #607636) * apt-inst/contrib/extracttar.cc: - let apt-utils work with encoded tar headers if uid/gid are large. Thanks to Nobuhiro Hayashi for the patch! (Closes: #330162) * apt-pkg/cacheiterator.h: - do not segfault if cache is not build (Closes: #254770) * doc/apt-get.8.xml: - remove duplicated mentioning of --install-recommends * doc/sources.list.5.xml: - remove obsolete references to non-us (Closes: #594495) * debian/rules: - use -- instead of deprecated -u for dh_gencontrol - remove shlibs.local creation and usage - show differences in the symbol files, but never fail * pre-build.sh: - remove as it is not needed for a working 'bzr bd' * debian/{apt,apt-utils}.symbols: - ship experimental unmangled c++ symbol files * methods/rred.cc: - operate optional on gzip compressed pdiffs * apt-pkg/acquire-item.cc: - don't uncompress downloaded pdiff files before feeding it to rred - try downloading clearsigned InRelease before trying Release.gpg - change the internal handling of Extensions in pkgAcqIndex - add a special uncompressed compression type to prefer those files - download and use i18n/Index to choose which Translations to download * cmdline/apt-key: - don't set trustdb-name as non-root so 'list' and 'finger' can be used without being root (Closes: #393005, #592107) * apt-pkg/deb/deblistparser.cc: - rewrite LoadReleaseInfo to cope with clearsigned Releasefiles * ftparchive/writer.cc: - add config option to search for more patterns in release command - include Index files by default in the Release file * methods/{gzip,bzip}.cc: - print a good error message if FileSize() is zero * apt-pkg/aptconfiguration.cc: - remove the inbuilt Translation files whitelist
Diffstat (limited to 'apt-pkg/acquire-item.h')
-rw-r--r--apt-pkg/acquire-item.h100
1 files changed, 96 insertions, 4 deletions
diff --git a/apt-pkg/acquire-item.h b/apt-pkg/acquire-item.h
index 943c61876..9bcc32f21 100644
--- a/apt-pkg/acquire-item.h
+++ b/apt-pkg/acquire-item.h
@@ -287,6 +287,50 @@ struct DiffInfo {
unsigned long size;
};
/*}}}*/
+/** \brief An item that is responsible for fetching a SubIndex {{{
+ *
+ * The MetaIndex file includes only records for important indexes
+ * and records for these SubIndex files so these can carry records
+ * for addition files like PDiffs and Translations
+ */
+class pkgAcqSubIndex : public pkgAcquire::Item
+{
+ protected:
+ /** \brief If \b true, debugging information will be written to std::clog. */
+ bool Debug;
+
+ /** \brief The item that is currently being downloaded. */
+ pkgAcquire::ItemDesc Desc;
+
+ /** \brief The Hash that this file should have after download
+ */
+ HashString ExpectedHash;
+
+ public:
+ // Specialized action members
+ virtual void Failed(string Message,pkgAcquire::MethodConfig *Cnf);
+ virtual void Done(string Message,unsigned long Size,string Md5Hash,
+ pkgAcquire::MethodConfig *Cnf);
+ virtual string DescURI() {return Desc.URI;};
+ virtual string Custom600Headers();
+ virtual bool ParseIndex(string const &IndexFile);
+
+ /** \brief Create a new pkgAcqDiffIndex.
+ *
+ * \param Owner The Acquire object that owns this item.
+ *
+ * \param URI The URI of the list file to download.
+ *
+ * \param URIDesc A long description of the list file to download.
+ *
+ * \param ShortDesc A short description of the list file to download.
+ *
+ * \param ExpectedHash The list file's MD5 signature.
+ */
+ pkgAcqSubIndex(pkgAcquire *Owner, string const &URI,string const &URIDesc,
+ string const &ShortDesc, HashString const &ExpectedHash);
+};
+ /*}}}*/
/** \brief An item that is responsible for fetching an index file of {{{
* package list diffs and starting the package list's download.
*
@@ -449,7 +493,7 @@ class pkgAcqIndexDiffs : public pkgAcquire::Item
StateFetchDiff,
/** \brief The diff is currently being uncompressed. */
- StateUnzipDiff,
+ StateUnzipDiff, // FIXME: No longer used
/** \brief The diff is currently being applied. */
StateApplyDiff
@@ -528,8 +572,8 @@ class pkgAcqIndex : public pkgAcquire::Item
/** \brief The expected hashsum of the decompressed index file. */
HashString ExpectedHash;
- /** \brief The compression-related file extension that is being
- * added to the downloaded file (e.g., ".gz" or ".bz2").
+ /** \brief The compression-related file extensions that are being
+ * added to the downloaded file one by one if first fails (e.g., "gz bz2").
*/
string CompressionExtension;
@@ -540,7 +584,7 @@ class pkgAcqIndex : public pkgAcquire::Item
virtual void Done(string Message,unsigned long Size,string Md5Hash,
pkgAcquire::MethodConfig *Cnf);
virtual string Custom600Headers();
- virtual string DescURI() {return RealURI + CompressionExtension;};
+ virtual string DescURI() {return Desc.URI;};
virtual string HashSum() {return ExpectedHash.toStr(); };
/** \brief Create a pkgAcqIndex.
@@ -565,6 +609,9 @@ class pkgAcqIndex : public pkgAcquire::Item
pkgAcqIndex(pkgAcquire *Owner,string URI,string URIDesc,
string ShortDesc, HashString ExpectedHash,
string compressExt="");
+ pkgAcqIndex(pkgAcquire *Owner, struct IndexTarget const * const Target,
+ HashString const &ExpectedHash, indexRecords const *MetaIndexParser);
+ void Init(string const &URI, string const &URIDesc, string const &ShortDesc);
};
/*}}}*/
/** \brief An acquire item that is responsible for fetching a {{{
@@ -594,6 +641,8 @@ class pkgAcqIndexTrans : public pkgAcqIndex
*/
pkgAcqIndexTrans(pkgAcquire *Owner,string URI,string URIDesc,
string ShortDesc);
+ pkgAcqIndexTrans(pkgAcquire *Owner, struct IndexTarget const * const Target,
+ HashString const &ExpectedHash, indexRecords const *MetaIndexParser);
};
/*}}}*/
/** \brief Information about an index file. */ /*{{{*/
@@ -612,8 +661,18 @@ struct IndexTarget
* looked up within the meta signature file.
*/
string MetaKey;
+
+ //FIXME: We should use virtual methods here instead…
+ bool IsOptional() const;
+ bool IsSubIndex() const;
};
/*}}}*/
+/** \brief Information about an optional index file. */ /*{{{*/
+struct OptionalIndexTarget : public IndexTarget
+{
+};
+ /*}}}*/
+
/** \brief An acquire item that downloads the detached signature {{{
* of a meta-index (Release) file, then queues up the release
* file itself.
@@ -772,6 +831,39 @@ class pkgAcqMetaIndex : public pkgAcquire::Item
indexRecords* MetaIndexParser);
};
/*}}}*/
+/** \brief An item repsonsible for downloading clearsigned metaindexes {{{*/
+class pkgAcqMetaClearSig : public pkgAcqMetaIndex
+{
+ /** \brief The URI of the meta-index file for the detached signature */
+ string MetaIndexURI;
+
+ /** \brief A "URI-style" description of the meta-index file */
+ string MetaIndexURIDesc;
+
+ /** \brief A brief description of the meta-index file */
+ string MetaIndexShortDesc;
+
+ /** \brief The URI of the detached meta-signature file if the clearsigned one failed. */
+ string MetaSigURI;
+
+ /** \brief A "URI-style" description of the meta-signature file */
+ string MetaSigURIDesc;
+
+ /** \brief A brief description of the meta-signature file */
+ string MetaSigShortDesc;
+
+public:
+ void Failed(string Message,pkgAcquire::MethodConfig *Cnf);
+
+ /** \brief Create a new pkgAcqMetaClearSig. */
+ pkgAcqMetaClearSig(pkgAcquire *Owner,
+ string const &URI, string const &URIDesc, string const &ShortDesc,
+ string const &MetaIndexURI, string const &MetaIndexURIDesc, string const &MetaIndexShortDesc,
+ string const &MetaSigURI, string const &MetaSigURIDesc, string const &MetaSigShortDesc,
+ const vector<struct IndexTarget*>* IndexTargets,
+ indexRecords* MetaIndexParser);
+};
+ /*}}}*/
/** \brief An item that is responsible for fetching a package file. {{{
*
* If the package file already exists in the cache, nothing will be