summaryrefslogtreecommitdiff
path: root/apt-pkg/acquire.h
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2010-05-04 10:06:57 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2010-05-04 10:06:57 +0200
commitaf8a8da9c1aa6506d230a0df8abc670661176ba3 (patch)
tree343935c56f2294c835082233398fdef5d5d5e2eb /apt-pkg/acquire.h
parent549edd163e34a50091623b47881f2eefbdc53aca (diff)
parentedde664d0cc5fe46f572696c605832700c553b9e (diff)
merged from davids branch
Diffstat (limited to 'apt-pkg/acquire.h')
-rw-r--r--apt-pkg/acquire.h31
1 files changed, 26 insertions, 5 deletions
diff --git a/apt-pkg/acquire.h b/apt-pkg/acquire.h
index 6c130c1b3..9e91a9f67 100644
--- a/apt-pkg/acquire.h
+++ b/apt-pkg/acquire.h
@@ -66,6 +66,8 @@
#ifndef PKGLIB_ACQUIRE_H
#define PKGLIB_ACQUIRE_H
+#include <apt-pkg/macros.h>
+
#include <vector>
#include <string>
@@ -161,7 +163,7 @@ class pkgAcquire
QueueAccess} QueueMode;
/** \brief If \b true, debugging information will be dumped to std::clog. */
- bool Debug;
+ bool const Debug;
/** \brief If \b true, a download is currently in progress. */
bool Running;
@@ -332,15 +334,22 @@ class pkgAcquire
*/
double PartialPresent();
- /** \brief Construct a new pkgAcquire.
+ /** \brief Delayed constructor
*
- * \param Log The progress indicator associated with this
- * download, or \b NULL for none. This object is not owned by the
+ * \param Progress indicator associated with this download or
+ * \b NULL for none. This object is not owned by the
* download process and will not be deleted when the pkgAcquire
* object is destroyed. Naturally, it should live for at least as
* long as the pkgAcquire object does.
+ * \param Lock defines a lock file that should be acquired to ensure
+ * only one Acquire class is in action at the time or an empty string
+ * if no lock file should be used.
*/
- pkgAcquire(pkgAcquireStatus *Log = 0);
+ bool Setup(pkgAcquireStatus *Progress = NULL, string const &Lock = "");
+
+ /** \brief Construct a new pkgAcquire. */
+ pkgAcquire(pkgAcquireStatus *Log) __deprecated;
+ pkgAcquire();
/** \brief Destroy this pkgAcquire object.
*
@@ -348,6 +357,18 @@ class pkgAcquire
* this download.
*/
virtual ~pkgAcquire();
+
+ private:
+ /** \brief FD of the Lock file we acquire in Setup (if any) */
+ int LockFD;
+
+ /** \brief Ensure the existence of the given Path
+ *
+ * \param Parent directory of the Path directory - a trailing
+ * /apt/ will be removed before CreateDirectory call.
+ * \param Path which should exist after (successful) call
+ */
+ bool CheckDirectory(string const &Parent, string const &Path) const;
};
/** \brief Represents a single download source from which an item