dropEmptyInitThenConcatStringsSep -> concatStringSep: store paths are not empty

This commit is contained in:
Robert Hensing 2024-07-13 01:02:30 +02:00
parent 49d100ba8b
commit f1966e22d9
4 changed files with 9 additions and 4 deletions

View File

@ -32,6 +32,8 @@
#include <nlohmann/json.hpp>
#include "strings.hh"
namespace nix {
DerivationGoal::DerivationGoal(const StorePath & drvPath,
@ -895,7 +897,7 @@ void runPostBuildHook(
std::map<std::string, std::string> hookEnvironment = getEnv();
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());
struct LogSink : Sink {

View File

@ -4,6 +4,7 @@
#include "store-api.hh"
#include "json-utils.hh"
#include "comparator.hh"
#include "strings.hh"
namespace nix {
@ -30,7 +31,7 @@ std::string ValidPathInfo::fingerprint(const Store & store) const
"1;" + store.printStorePath(path) + ";"
+ narHash.to_string(HashFormat::Nix32, true) + ";"
+ std::to_string(narSize) + ";"
+ dropEmptyInitThenConcatStringsSep(",", store.printStorePathSet(references));
+ concatStringsSep(",", store.printStorePathSet(references));
}

View File

@ -22,6 +22,8 @@
#include <filesystem>
#include <nlohmann/json.hpp>
#include "strings.hh"
using json = nlohmann::json;
namespace nix {
@ -1208,7 +1210,7 @@ std::string StoreDirConfig::showPaths(const StorePathSet & paths)
std::string showPaths(const PathSet & paths)
{
return dropEmptyInitThenConcatStringsSep(", ", quoteStrings(paths));
return concatStringsSep(", ", quoteStrings(paths));
}

View File

@ -815,7 +815,7 @@ struct CmdProfileList : virtual EvalCommand, virtual StoreCommand, MixDefaultPro
logger->cout("Original flake URL: %s", element.source->originalRef.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)));
}
}
}