summaryrefslogtreecommitdiff
path: root/methods
diff options
context:
space:
mode:
authorIshan Jayawardena <udeshike@gmail.com>2011-07-16 14:41:53 +0530
committerIshan Jayawardena <udeshike@gmail.com>2011-07-16 14:41:53 +0530
commit8a8ea4baa11f07e1de4cf190f82dbd79ff1affa5 (patch)
treef8710b0994c439f46e75c8f28af0f6b8251f380c /methods
parent3efe86af099d5a5d05e2e61a571da864676834c7 (diff)
parent0df8c3dccbda739af6e20999fb208ada0619ad80 (diff)
fixed indentation issues
Diffstat (limited to 'methods')
-rw-r--r--methods/gpgv.cc13
-rw-r--r--methods/http.h2
-rw-r--r--methods/mirror.cc19
-rw-r--r--methods/mirror.h1
4 files changed, 27 insertions, 8 deletions
diff --git a/methods/gpgv.cc b/methods/gpgv.cc
index efe1f73f7..960c06180 100644
--- a/methods/gpgv.cc
+++ b/methods/gpgv.cc
@@ -65,13 +65,16 @@ string GPGVMethod::VerifyGetSigners(const char *file, const char *outfile,
return string("Couldn't spawn new process") + strerror(errno);
else if (pid == 0)
{
- if (SigVerify::RunGPGV(outfile, file, 3, fd) == false)
+ _error->PushToStack();
+ bool const success = SigVerify::RunGPGV(outfile, file, 3, fd);
+ if (success == false)
{
- // TRANSLATOR: %s is the trusted keyring parts directory
- ioprintf(ret, _("No keyring installed in %s."),
- _config->FindDir("Dir::Etc::TrustedParts").c_str());
- return ret.str();
+ string errmsg;
+ _error->PopMessage(errmsg);
+ _error->RevertToStack();
+ return errmsg;
}
+ _error->RevertToStack();
exit(111);
}
close(fd[1]);
diff --git a/methods/http.h b/methods/http.h
index 0bc019e77..aa96c6810 100644
--- a/methods/http.h
+++ b/methods/http.h
@@ -182,7 +182,7 @@ class HttpMethod : public pkgAcqMethod
string AutoDetectProxyCmd;
public:
- friend class ServerState;
+ friend struct ServerState;
FileFd *File;
ServerState *Server;
diff --git a/methods/mirror.cc b/methods/mirror.cc
index 2cf5c9ce1..713dc211a 100644
--- a/methods/mirror.cc
+++ b/methods/mirror.cc
@@ -134,6 +134,10 @@ bool MirrorMethod::DownloadMirrorFile(string mirror_uri_str)
string fetch = BaseUri;
fetch.replace(0,strlen("mirror://"),"http://");
+ // append the dist as a query string
+ if (Dist != "")
+ fetch += "?dist=" + Dist;
+
if(Debug)
clog << "MirrorMethod::DownloadMirrorFile(): '" << fetch << "'"
<< " to " << MirrorFile << endl;
@@ -274,8 +278,18 @@ bool MirrorMethod::InitMirrors()
while (!in.eof())
{
getline(in, s);
- if (s.size() > 0)
- AllMirrors.push_back(s);
+
+ // ignore lines that start with #
+ if (s.find("#") == 0)
+ continue;
+ // ignore empty lines
+ if (s.size() == 0)
+ continue;
+ // ignore non http lines
+ if (s.find("http://") != 0)
+ continue;
+
+ AllMirrors.push_back(s);
}
Mirror = AllMirrors[0];
UsedMirror = Mirror;
@@ -329,6 +343,7 @@ string MirrorMethod::GetMirrorFileName(string mirror_uri_str)
if(Debug)
std::cerr << "found BaseURI: " << uristr << std::endl;
BaseUri = uristr.substr(0,uristr.size()-1);
+ Dist = (*I)->GetDist();
}
}
// get new file
diff --git a/methods/mirror.h b/methods/mirror.h
index bd807e122..97d18144a 100644
--- a/methods/mirror.h
+++ b/methods/mirror.h
@@ -29,6 +29,7 @@ class MirrorMethod : public HttpMethod
vector<string> AllMirrors; // all available mirrors
string MirrorFile; // the file that contains the list of mirrors
bool DownloadedMirrorFile; // already downloaded this session
+ string Dist; // the target distrubtion (e.g. sid, oneiric)
bool Debug;