summaryrefslogtreecommitdiff
path: root/methods/mirror.h
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2010-06-09 11:51:21 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2010-06-09 11:51:21 +0200
commit23c5897cbdb5a957788201a5178e963586dcdbc9 (patch)
tree8303be690b404c47d7a2da310175e1a40c62348c /methods/mirror.h
parent6dd8400ca787ef832d87121f304f98ad152dc3a6 (diff)
parent164fed49362b28c0264c293a14a06d167e32b76f (diff)
* merge the remaining Ubuntu change:
- on gpg verification failure warn and restore the last known good state - on failure display the IP of the server (useful for servers that use round robin DNS) - support Original-Maintainer in RewritePackageOrder - enable cdrom autodetection via libudev by default - show messsage about Vcs in use when apt-get source is run for packages maintained in a Vcs - better support transitional packages with mark auto-installed. when the transitional package is in "oldlibs" the new package is not marked auto installed (same is true for section metapackages) - provide new "deb mirror://archive.foo/mirrors.list sid main" method expects a list of mirrors (generated on the server e.g. via geoip) and will use that, including cycle on failure - write apport crash file on package failure (disabled by default on debian until apport is available) - support mirror failure reporting (disabled by default on debian)
Diffstat (limited to 'methods/mirror.h')
-rw-r--r--methods/mirror.h52
1 files changed, 52 insertions, 0 deletions
diff --git a/methods/mirror.h b/methods/mirror.h
new file mode 100644
index 000000000..ed817806b
--- /dev/null
+++ b/methods/mirror.h
@@ -0,0 +1,52 @@
+// -*- mode: cpp; mode: fold -*-
+// Description /*{{{*/// $Id: http.h,v 1.12 2002/04/18 05:09:38 jgg Exp $
+// $Id: http.h,v 1.12 2002/04/18 05:09:38 jgg Exp $
+/* ######################################################################
+
+ MIRROR Aquire Method - This is the MIRROR aquire method for APT.
+
+ ##################################################################### */
+ /*}}}*/
+
+#ifndef APT_MIRROR_H
+#define APT_MIRROR_H
+
+
+#include <iostream>
+
+using std::cout;
+using std::cerr;
+using std::endl;
+
+#include "http.h"
+
+class MirrorMethod : public HttpMethod
+{
+ FetchResult Res;
+ // we simply transform between BaseUri and Mirror
+ string BaseUri; // the original mirror://... url
+ string Mirror; // the selected mirror uri (http://...)
+ string MirrorFile; // the file that contains the list of mirrors
+ bool DownloadedMirrorFile; // already downloaded this session
+
+ bool Debug;
+
+ protected:
+ bool DownloadMirrorFile(string uri);
+ string GetMirrorFileName(string uri);
+ bool SelectMirror();
+ bool Clean(string dir);
+
+ // we need to overwrite those to transform the url back
+ virtual void Fail(string Why, bool Transient = false);
+ virtual void URIStart(FetchResult &Res);
+ virtual void URIDone(FetchResult &Res,FetchResult *Alt = 0);
+ virtual bool Configuration(string Message);
+
+ public:
+ MirrorMethod();
+ virtual bool Fetch(FetchItem *Itm);
+};
+
+
+#endif