1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-04 03:01:47 +02:00

dropEmptyInitThenConcatStringsSep -> concatStringSep: shortRefs are not empty

This commit is contained in:
Robert Hensing 2024-07-13 00:50:39 +02:00
parent 608a425550
commit d3e49ac881
4 changed files with 20 additions and 4 deletions

View file

@ -339,7 +339,7 @@ public:
(narInfo ? narInfo->fileSize : 0, narInfo != 0 && narInfo->fileSize)
(info->narHash.to_string(HashFormat::Nix32, true))
(info->narSize)
(dropEmptyInitThenConcatStringsSep(" ", info->shortRefs()))
(concatStringsSep(" ", info->shortRefs()))
(info->deriver ? std::string(info->deriver->to_string()) : "", (bool) info->deriver)
(concatStringsSep(" ", info->sigs))
(renderContentAddress(info->ca))

View file

@ -1,6 +1,7 @@
#include "globals.hh"
#include "nar-info.hh"
#include "store-api.hh"
#include "strings.hh"
namespace nix {
@ -111,7 +112,7 @@ std::string NarInfo::to_string(const Store & store) const
res += "NarHash: " + narHash.to_string(HashFormat::Nix32, true) + "\n";
res += "NarSize: " + std::to_string(narSize) + "\n";
res += "References: " + dropEmptyInitThenConcatStringsSep(" ", shortRefs()) + "\n";
res += "References: " + concatStringsSep(" ", shortRefs()) + "\n";
if (deriver)
res += "Deriver: " + std::string(deriver->to_string()) + "\n";

View file

@ -171,6 +171,9 @@ struct ValidPathInfo : UnkeyedValidPathInfo {
*/
bool checkSignature(const Store & store, const PublicKeys & publicKeys, const std::string & sig) const;
/**
* References as store path basenames, including a self reference if it has one.
*/
Strings shortRefs() const;
ValidPathInfo(const ValidPathInfo & other) = default;