mirror of
https://github.com/NixOS/nix
synced 2025-06-25 23:11:16 +02:00
dropEmptyInitThenConcatStringsSep -> concatStringSep: store paths are not empty
This commit is contained in:
parent
49d100ba8b
commit
f1966e22d9
4 changed files with 9 additions and 4 deletions
|
@ -32,6 +32,8 @@
|
||||||
|
|
||||||
#include <nlohmann/json.hpp>
|
#include <nlohmann/json.hpp>
|
||||||
|
|
||||||
|
#include "strings.hh"
|
||||||
|
|
||||||
namespace nix {
|
namespace nix {
|
||||||
|
|
||||||
DerivationGoal::DerivationGoal(const StorePath & drvPath,
|
DerivationGoal::DerivationGoal(const StorePath & drvPath,
|
||||||
|
@ -895,7 +897,7 @@ void runPostBuildHook(
|
||||||
std::map<std::string, std::string> hookEnvironment = getEnv();
|
std::map<std::string, std::string> hookEnvironment = getEnv();
|
||||||
|
|
||||||
hookEnvironment.emplace("DRV_PATH", store.printStorePath(drvPath));
|
hookEnvironment.emplace("DRV_PATH", store.printStorePath(drvPath));
|
||||||
hookEnvironment.emplace("OUT_PATHS", chomp(dropEmptyInitThenConcatStringsSep(" ", store.printStorePathSet(outputPaths))));
|
hookEnvironment.emplace("OUT_PATHS", chomp(concatStringsSep(" ", store.printStorePathSet(outputPaths))));
|
||||||
hookEnvironment.emplace("NIX_CONFIG", globalConfig.toKeyValue());
|
hookEnvironment.emplace("NIX_CONFIG", globalConfig.toKeyValue());
|
||||||
|
|
||||||
struct LogSink : Sink {
|
struct LogSink : Sink {
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
#include "store-api.hh"
|
#include "store-api.hh"
|
||||||
#include "json-utils.hh"
|
#include "json-utils.hh"
|
||||||
#include "comparator.hh"
|
#include "comparator.hh"
|
||||||
|
#include "strings.hh"
|
||||||
|
|
||||||
namespace nix {
|
namespace nix {
|
||||||
|
|
||||||
|
@ -30,7 +31,7 @@ std::string ValidPathInfo::fingerprint(const Store & store) const
|
||||||
"1;" + store.printStorePath(path) + ";"
|
"1;" + store.printStorePath(path) + ";"
|
||||||
+ narHash.to_string(HashFormat::Nix32, true) + ";"
|
+ narHash.to_string(HashFormat::Nix32, true) + ";"
|
||||||
+ std::to_string(narSize) + ";"
|
+ std::to_string(narSize) + ";"
|
||||||
+ dropEmptyInitThenConcatStringsSep(",", store.printStorePathSet(references));
|
+ concatStringsSep(",", store.printStorePathSet(references));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -22,6 +22,8 @@
|
||||||
#include <filesystem>
|
#include <filesystem>
|
||||||
#include <nlohmann/json.hpp>
|
#include <nlohmann/json.hpp>
|
||||||
|
|
||||||
|
#include "strings.hh"
|
||||||
|
|
||||||
using json = nlohmann::json;
|
using json = nlohmann::json;
|
||||||
|
|
||||||
namespace nix {
|
namespace nix {
|
||||||
|
@ -1208,7 +1210,7 @@ std::string StoreDirConfig::showPaths(const StorePathSet & paths)
|
||||||
|
|
||||||
std::string showPaths(const PathSet & paths)
|
std::string showPaths(const PathSet & paths)
|
||||||
{
|
{
|
||||||
return dropEmptyInitThenConcatStringsSep(", ", quoteStrings(paths));
|
return concatStringsSep(", ", quoteStrings(paths));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -815,7 +815,7 @@ struct CmdProfileList : virtual EvalCommand, virtual StoreCommand, MixDefaultPro
|
||||||
logger->cout("Original flake URL: %s", element.source->originalRef.to_string());
|
logger->cout("Original flake URL: %s", element.source->originalRef.to_string());
|
||||||
logger->cout("Locked flake URL: %s", element.source->lockedRef.to_string());
|
logger->cout("Locked flake URL: %s", element.source->lockedRef.to_string());
|
||||||
}
|
}
|
||||||
logger->cout("Store paths: %s", dropEmptyInitThenConcatStringsSep(" ", store->printStorePathSet(element.storePaths)));
|
logger->cout("Store paths: %s", concatStringsSep(" ", store->printStorePathSet(element.storePaths)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue