From c7589cce8d3f9fcb7769e424f341dba8fb3545d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Thu, 29 Mar 2018 16:56:00 +0200 Subject: daemon: Remove dead code. * nix/libstore/globals.cc (Settings::loadConfFile, Settings::unpack): Remove. * nix/libstore/globals.hh: Adjust accordingly. * nix/libstore/misc.cc (queryMissing): Remove. * nix/libstore/misc.hh: Adjust accordingly. * nix/libstore/store-api.cc (followLinksToStore) (followLinksToStorePath, computeStorePathForHash): Remove. * nix/libstore/store-api.hh: Adjust accordingly. --- nix/libstore/globals.cc | 44 -------------------------------------------- 1 file changed, 44 deletions(-) (limited to 'nix/libstore/globals.cc') diff --git a/nix/libstore/globals.cc b/nix/libstore/globals.cc index 4ab6c3a0f9..fcafac2df6 100644 --- a/nix/libstore/globals.cc +++ b/nix/libstore/globals.cc @@ -78,39 +78,6 @@ void Settings::processEnvironment() } -void Settings::loadConfFile() -{ - Path settingsFile = (format("%1%/%2%") % nixConfDir % "nix.conf").str(); - if (!pathExists(settingsFile)) return; - string contents = readFile(settingsFile); - - unsigned int pos = 0; - - while (pos < contents.size()) { - string line; - while (pos < contents.size() && contents[pos] != '\n') - line += contents[pos++]; - pos++; - - string::size_type hash = line.find('#'); - if (hash != string::npos) - line = string(line, 0, hash); - - vector tokens = tokenizeString >(line); - if (tokens.empty()) continue; - - if (tokens.size() < 2 || tokens[1] != "=") - throw Error(format("illegal configuration line `%1%' in `%2%'") % line % settingsFile); - - string name = tokens[0]; - - vector::iterator i = tokens.begin(); - advance(i, 2); - settings[name] = concatStringsSep(" ", Strings(i, tokens.end())); // FIXME: slow - }; -} - - void Settings::set(const string & name, const string & value) { settings[name] = value; @@ -256,17 +223,6 @@ string Settings::pack() } -void Settings::unpack(const string & pack) { - Strings lines = tokenizeString(pack, "\n"); - foreach (Strings::iterator, i, lines) { - string::size_type eq = i->find('='); - if (eq == string::npos) - throw Error("illegal option name/value"); - set(i->substr(0, eq), i->substr(eq + 1)); - } -} - - Settings::SettingsMap Settings::getOverrides() { return overrides; -- cgit v1.2.3