1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-06 21:41:48 +02:00

Use StringMap instead of std::map<std::string, std::string> throughout the codebase

This commit is contained in:
Sergei Zimmerman 2025-05-19 20:33:28 +00:00
parent 8c10104e9e
commit 8ee513379a
No known key found for this signature in database
GPG key ID: A9B0B557CA632325
26 changed files with 37 additions and 37 deletions

View file

@ -974,7 +974,7 @@ void runPostBuildHook(
fmt("running post-build-hook '%s'", settings.postBuildHook),
Logger::Fields{store.printStorePath(drvPath)});
PushActivity pact(act.id);
std::map<std::string, std::string> hookEnvironment = getEnv();
StringMap hookEnvironment = getEnv();
hookEnvironment.emplace("DRV_PATH", store.printStorePath(drvPath));
hookEnvironment.emplace("OUT_PATHS", chomp(concatStringsSep(" ", store.printStorePathSet(outputPaths))));

View file

@ -125,7 +125,7 @@ struct StoreDirConfigBase : Config
*/
struct StoreDirConfig : StoreDirConfigBase, MixStoreDirMethods
{
using Params = std::map<std::string, std::string>;
using Params = StringMap;
StoreDirConfig(const Params & params);

View file

@ -41,7 +41,7 @@ namespace nix {
*/
struct StoreReference
{
using Params = std::map<std::string, std::string>;
using Params = StringMap;
/**
* Special store reference `""` or `"auto"`

View file

@ -96,7 +96,7 @@ Realisation Realisation::fromJSON(
std::map <DrvOutput, StorePath> dependentRealisations;
if (auto jsonDependencies = json.find("dependentRealisations"); jsonDependencies != json.end())
for (auto & [jsonDepId, jsonDepOutPath] : jsonDependencies->get<std::map<std::string, std::string>>())
for (auto & [jsonDepId, jsonDepOutPath] : jsonDependencies->get<StringMap>())
dependentRealisations.insert({DrvOutput::parse(jsonDepId), StorePath(jsonDepOutPath)});
return Realisation{

View file

@ -83,7 +83,7 @@ bool SSHMaster::isMasterRunning() {
Strings createSSHEnv()
{
// Copy the environment and set SHELL=/bin/sh
std::map<std::string, std::string> env = getEnv();
StringMap env = getEnv();
// SSH will invoke the "user" shell for -oLocalCommand, but that means
// $SHELL. To keep things simple and avoid potential issues with other

View file

@ -187,7 +187,7 @@ private:
typedef std::map<Path, ChrootPath> PathsInChroot; // maps target path to source path
PathsInChroot pathsInChroot;
typedef std::map<std::string, std::string> Environment;
typedef StringMap Environment;
Environment env;
/**