From 2fd8f8bb99a2832b3684878c020ba47322e79332 Mon Sep 17 00:00:00 2001 From: Jörg Thalheim Date: Sun, 30 Jul 2017 12:27:57 +0100 Subject: Replace Unicode quotes in user-facing strings by ASCII MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Relevant RFC: NixOS/rfcs#4 $ ag -l | xargs sed -i -e "/\"/s/’/'/g;/\"/s/‘/'/g" --- src/nix-env/nix-env.cc | 62 ++++++++++++++++++++++++------------------------- src/nix-env/user-env.cc | 2 +- 2 files changed, 32 insertions(+), 32 deletions(-) (limited to 'src/nix-env') diff --git a/src/nix-env/nix-env.cc b/src/nix-env/nix-env.cc index 8620cd25574e..94fbc09f6642 100644 --- a/src/nix-env/nix-env.cc +++ b/src/nix-env/nix-env.cc @@ -70,7 +70,7 @@ static string needArg(Strings::iterator & i, Strings & args, const string & arg) { if (i == args.end()) throw UsageError( - format("‘%1%’ requires an argument") % arg); + format("'%1%' requires an argument") % arg); return *i++; } @@ -124,7 +124,7 @@ static void getAllExprs(EvalState & state, if (hasSuffix(attrName, ".nix")) attrName = string(attrName, 0, attrName.size() - 4); if (attrs.find(attrName) != attrs.end()) { - printError(format("warning: name collision in input Nix expressions, skipping ‘%1%’") % path2); + printError(format("warning: name collision in input Nix expressions, skipping '%1%'") % path2); continue; } attrs.insert(attrName); @@ -133,7 +133,7 @@ static void getAllExprs(EvalState & state, Value & vArg(*state.allocValue()); mkString(vArg, path2); if (v.attrs->size() == v.attrs->capacity()) - throw Error(format("too many Nix expressions in directory ‘%1%’") % path); + throw Error(format("too many Nix expressions in directory '%1%'") % path); mkApp(*state.allocAttr(v, state.symbols.create(attrName)), vFun, vArg); } else if (S_ISDIR(st.st_mode)) @@ -148,7 +148,7 @@ static void loadSourceExpr(EvalState & state, const Path & path, Value & v) { struct stat st; if (stat(path.c_str(), &st) == -1) - throw SysError(format("getting information about ‘%1%’") % path); + throw SysError(format("getting information about '%1%'") % path); if (isNixExpr(path, st)) { state.evalFile(path, v); @@ -226,7 +226,7 @@ static void checkSelectorUse(DrvNames & selectors) /* Check that all selectors have been used. */ for (auto & i : selectors) if (i.hits == 0 && i.fullName != "*") - throw Error(format("selector ‘%1%’ matches no derivations") % i.fullName); + throw Error(format("selector '%1%' matches no derivations") % i.fullName); } @@ -297,7 +297,7 @@ static DrvInfos filterBySelector(EvalState & state, const DrvInfos & allElems, for (auto & j : newest) { if (multiple.find(j.second.first.queryName()) != multiple.end()) printInfo( - "warning: there are multiple derivations named ‘%1%’; using the first one", + "warning: there are multiple derivations named '%1%'; using the first one", j.second.first.queryName()); matches.push_back(j.second); } @@ -489,13 +489,13 @@ static void installDerivations(Globals & globals, if (!globals.preserveInstalled && newNames.find(drvName.name) != newNames.end() && !keep(i)) - printInfo("replacing old ‘%s’", i.queryName()); + printInfo("replacing old '%s'", i.queryName()); else allElems.push_back(i); } for (auto & i : newElems) - printInfo("installing ‘%s’", i.queryName()); + printInfo("installing '%s'", i.queryName()); } printMissing(*globals.state, newElems); @@ -517,7 +517,7 @@ static void opInstall(Globals & globals, Strings opFlags, Strings opArgs) globals.preserveInstalled = true; else if (arg == "--remove-all" || arg == "-r") globals.removeAll = true; - else throw UsageError(format("unknown flag ‘%1%’") % arg); + else throw UsageError(format("unknown flag '%1%'") % arg); } installDerivations(globals, opArgs, globals.profile); @@ -597,13 +597,13 @@ static void upgradeDerivations(Globals & globals, { const char * action = compareVersions(drvName.version, bestVersion) <= 0 ? "upgrading" : "downgrading"; - printInfo("%1% ‘%2%’ to ‘%3%’", + printInfo("%1% '%2%' to '%3%'", action, i.queryName(), bestElem->queryName()); newElems.push_back(*bestElem); } else newElems.push_back(i); } catch (Error & e) { - e.addPrefix(fmt("while trying to find an upgrade for ‘%s’:\n", i.queryName())); + e.addPrefix(fmt("while trying to find an upgrade for '%s':\n", i.queryName())); throw; } } @@ -628,7 +628,7 @@ static void opUpgrade(Globals & globals, Strings opFlags, Strings opArgs) else if (arg == "--leq") upgradeType = utLeq; else if (arg == "--eq") upgradeType = utEq; else if (arg == "--always") upgradeType = utAlways; - else throw UsageError(format("unknown flag ‘%1%’") % arg); + else throw UsageError(format("unknown flag '%1%'") % arg); } upgradeDerivations(globals, opArgs, upgradeType); @@ -647,9 +647,9 @@ static void setMetaFlag(EvalState & state, DrvInfo & drv, static void opSetFlag(Globals & globals, Strings opFlags, Strings opArgs) { if (opFlags.size() > 0) - throw UsageError(format("unknown flag ‘%1%’") % opFlags.front()); + throw UsageError(format("unknown flag '%1%'") % opFlags.front()); if (opArgs.size() < 2) - throw UsageError("not enough arguments to ‘--set-flag’"); + throw UsageError("not enough arguments to '--set-flag'"); Strings::iterator arg = opArgs.begin(); string flagName = *arg++; @@ -666,7 +666,7 @@ static void opSetFlag(Globals & globals, Strings opFlags, Strings opArgs) DrvName drvName(i.queryName()); for (auto & j : selectors) if (j.matches(drvName)) { - printInfo("setting flag on ‘%1%’", i.queryName()); + printInfo("setting flag on '%1%'", i.queryName()); j.hits++; setMetaFlag(*globals.state, i, flagName, flagValue); break; @@ -690,7 +690,7 @@ static void opSet(Globals & globals, Strings opFlags, Strings opArgs) for (Strings::iterator i = opFlags.begin(); i != opFlags.end(); ) { string arg = *i++; if (parseInstallSourceOptions(globals, i, opFlags, arg)) ; - else throw UsageError(format("unknown flag ‘%1%’") % arg); + else throw UsageError(format("unknown flag '%1%'") % arg); } DrvInfos elems; @@ -740,7 +740,7 @@ static void uninstallDerivations(Globals & globals, Strings & selectors, if ((isPath(j) && i.queryOutPath() == globals.state->store->followLinksToStorePath(j)) || DrvName(j).matches(drvName)) { - printInfo("uninstalling ‘%s’", i.queryName()); + printInfo("uninstalling '%s'", i.queryName()); found = true; break; } @@ -758,7 +758,7 @@ static void uninstallDerivations(Globals & globals, Strings & selectors, static void opUninstall(Globals & globals, Strings opFlags, Strings opArgs) { if (opFlags.size() > 0) - throw UsageError(format("unknown flag ‘%1%’") % opFlags.front()); + throw UsageError(format("unknown flag '%1%'") % opFlags.front()); uninstallDerivations(globals, opArgs, globals.profile); } @@ -868,7 +868,7 @@ static void queryJSON(Globals & globals, vector & elems) auto placeholder = metaObj.placeholder(j); Value * v = i.queryMeta(j); if (!v) { - printError("derivation ‘%s’ has invalid meta attribute ‘%s’", i.queryName(), j); + printError("derivation '%s' has invalid meta attribute '%s'", i.queryName(), j); placeholder.write(nullptr); } else { PathSet context; @@ -918,7 +918,7 @@ static void opQuery(Globals & globals, Strings opFlags, Strings opArgs) else if (arg == "--attr" || arg == "-A") attrPath = needArg(i, opFlags, arg); else - throw UsageError(format("unknown flag ‘%1%’") % arg); + throw UsageError(format("unknown flag '%1%'") % arg); } @@ -965,7 +965,7 @@ static void opQuery(Globals & globals, Strings opFlags, Strings opArgs) try { paths.insert(i.queryOutPath()); } catch (AssertionError & e) { - printMsg(lvlTalkative, "skipping derivation named ‘%s’ which gives an assertion failure", i.queryName()); + printMsg(lvlTalkative, "skipping derivation named '%s' which gives an assertion failure", i.queryName()); i.setFailed(); } validPaths = globals.state->store->queryValidPaths(paths); @@ -991,7 +991,7 @@ static void opQuery(Globals & globals, Strings opFlags, Strings opArgs) try { if (i.hasFailed()) continue; - //Activity act(*logger, lvlDebug, format("outputting query result ‘%1%’") % i.attrPath); + //Activity act(*logger, lvlDebug, format("outputting query result '%1%'") % i.attrPath); if (globals.prebuiltOnly && validPaths.find(i.queryOutPath()) == validPaths.end() && @@ -1112,7 +1112,7 @@ static void opQuery(Globals & globals, Strings opFlags, Strings opArgs) attrs2["name"] = j; Value * v = i.queryMeta(j); if (!v) - printError("derivation ‘%s’ has invalid meta attribute ‘%s’", i.queryName(), j); + printError("derivation '%s' has invalid meta attribute '%s'", i.queryName(), j); else { if (v->type == tString) { attrs2["type"] = "string"; @@ -1163,9 +1163,9 @@ static void opQuery(Globals & globals, Strings opFlags, Strings opArgs) cout.flush(); } catch (AssertionError & e) { - printMsg(lvlTalkative, "skipping derivation named ‘%1%’ which gives an assertion failure", i.queryName()); + printMsg(lvlTalkative, "skipping derivation named '%1%' which gives an assertion failure", i.queryName()); } catch (Error & e) { - e.addPrefix(fmt("while querying the derivation named ‘%1%’:\n", i.queryName())); + e.addPrefix(fmt("while querying the derivation named '%1%':\n", i.queryName())); throw; } } @@ -1177,7 +1177,7 @@ static void opQuery(Globals & globals, Strings opFlags, Strings opArgs) static void opSwitchProfile(Globals & globals, Strings opFlags, Strings opArgs) { if (opFlags.size() > 0) - throw UsageError(format("unknown flag ‘%1%’") % opFlags.front()); + throw UsageError(format("unknown flag '%1%'") % opFlags.front()); if (opArgs.size() != 1) throw UsageError(format("exactly one argument expected")); @@ -1225,7 +1225,7 @@ static void switchGeneration(Globals & globals, int dstGen) static void opSwitchGeneration(Globals & globals, Strings opFlags, Strings opArgs) { if (opFlags.size() > 0) - throw UsageError(format("unknown flag ‘%1%’") % opFlags.front()); + throw UsageError(format("unknown flag '%1%'") % opFlags.front()); if (opArgs.size() != 1) throw UsageError(format("exactly one argument expected")); @@ -1240,7 +1240,7 @@ static void opSwitchGeneration(Globals & globals, Strings opFlags, Strings opArg static void opRollback(Globals & globals, Strings opFlags, Strings opArgs) { if (opFlags.size() > 0) - throw UsageError(format("unknown flag ‘%1%’") % opFlags.front()); + throw UsageError(format("unknown flag '%1%'") % opFlags.front()); if (opArgs.size() != 0) throw UsageError(format("no arguments expected")); @@ -1251,7 +1251,7 @@ static void opRollback(Globals & globals, Strings opFlags, Strings opArgs) static void opListGenerations(Globals & globals, Strings opFlags, Strings opArgs) { if (opFlags.size() > 0) - throw UsageError(format("unknown flag ‘%1%’") % opFlags.front()); + throw UsageError(format("unknown flag '%1%'") % opFlags.front()); if (opArgs.size() != 0) throw UsageError(format("no arguments expected")); @@ -1278,7 +1278,7 @@ static void opListGenerations(Globals & globals, Strings opFlags, Strings opArgs static void opDeleteGenerations(Globals & globals, Strings opFlags, Strings opArgs) { if (opFlags.size() > 0) - throw UsageError(format("unknown flag ‘%1%’") % opFlags.front()); + throw UsageError(format("unknown flag '%1%'") % opFlags.front()); if (opArgs.size() == 1 && opArgs.front() == "old") { deleteOldGenerations(globals.profile, globals.dryRun); @@ -1289,7 +1289,7 @@ static void opDeleteGenerations(Globals & globals, Strings opFlags, Strings opAr for (auto & i : opArgs) { unsigned int n; if (!string2Int(i, n)) - throw UsageError(format("invalid generation number ‘%1%’") % i); + throw UsageError(format("invalid generation number '%1%'") % i); gens.insert(n); } deleteGenerations(globals.profile, gens, globals.dryRun); diff --git a/src/nix-env/user-env.cc b/src/nix-env/user-env.cc index df5105f12c2a..7b9a88281171 100644 --- a/src/nix-env/user-env.cc +++ b/src/nix-env/user-env.cc @@ -140,7 +140,7 @@ bool createUserEnv(EvalState & state, DrvInfos & elems, Path lockTokenCur = optimisticLockProfile(profile); if (lockToken != lockTokenCur) { - printError(format("profile ‘%1%’ changed while we were busy; restarting") % profile); + printError(format("profile '%1%' changed while we were busy; restarting") % profile); return false; } -- cgit 1.4.1