From 2246aa77d291e07141f6a508e46730e2c28e1d84 Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Wed, 12 Feb 2014 07:22:36 -0500 Subject: [PATCH] Remove using declarations from download-via-ssh Signed-off-by: Shea Levy --- src/download-via-ssh/download-via-ssh.cc | 36 +++++++++++------------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/src/download-via-ssh/download-via-ssh.cc b/src/download-via-ssh/download-via-ssh.cc index be70a374f..5aa1e00ee 100644 --- a/src/download-via-ssh/download-via-ssh.cc +++ b/src/download-via-ssh/download-via-ssh.cc @@ -10,16 +10,13 @@ #include using namespace nix; -using std::pair; -using std::cout; -using std::endl; // !!! TODO: // * Respect more than the first host // * use a database // * show progress -static pair connect(string conn) { +static std::pair connect(string conn) { Pipe to, from; to.create(); from.create(); @@ -51,21 +48,20 @@ static pair connect(string conn) { // If we exit unexpectedly, child will EPIPE or EOF early. // So no need to keep track of it. - return pair(to.writeSide.borrow(), from.readSide.borrow()); + return std::pair(to.writeSide.borrow(), from.readSide.borrow()); } -static void substitute(pair & pipes, Path storePath, Path destPath) { +static void substitute(std::pair & pipes, Path storePath, Path destPath) { writeInt(cmdSubstitute, pipes.first); writeString(storePath, pipes.first); pipes.first.flush(); restorePath(destPath, pipes.second); - cout << endl; + std::cout << std::endl; } -static void query(pair & pipes) { - using std::cin; +static void query(std::pair & pipes) { writeInt(cmdQuery, pipes.first); - for (string line; getline(cin, line);) { + for (string line; getline(std::cin, line);) { Strings tokenized = tokenizeString(line); string cmd = tokenized.front(); tokenized.pop_front(); @@ -76,25 +72,25 @@ static void query(pair & pipes) { pipes.first.flush(); PathSet paths = readStrings(pipes.second); foreach (PathSet::iterator, i, paths) - cout << *i << endl; + std::cout << *i << std::endl; } else if (cmd == "info") { writeInt(qCmdInfo, pipes.first); foreach (Strings::iterator, i, tokenized) writeStrings(tokenized, pipes.first); pipes.first.flush(); for (Path path = readString(pipes.second); !path.empty(); path = readString(pipes.second)) { - cout << path << endl; - cout << readString(pipes.second) << endl; + std::cout << path << std::endl; + std::cout << readString(pipes.second) << std::endl; PathSet references = readStrings(pipes.second); - cout << references.size() << endl; + std::cout << references.size() << std::endl; foreach (PathSet::iterator, i, references) - cout << *i << endl; - cout << readLongLong(pipes.second) << endl; - cout << readLongLong(pipes.second) << endl; + std::cout << *i << std::endl; + std::cout << readLongLong(pipes.second) << std::endl; + std::cout << readLongLong(pipes.second) << std::endl; } } else throw Error(format("Unknown substituter query `%1%'") % cmd); - cout << endl; + std::cout << std::endl; } } @@ -106,9 +102,9 @@ void run(Strings args) if (settings.sshSubstituterHosts.empty()) return; - cout << endl; + std::cout << std::endl; - pair pipes = connect(settings.sshSubstituterHosts.front()); + std::pair pipes = connect(settings.sshSubstituterHosts.front()); /* Exchange the greeting */ writeInt(SERVE_MAGIC_1, pipes.first);