diff options
author | Vincent Ambo <tazjin@google.com> | 2020-05-18T01·34+0100 |
---|---|---|
committer | Vincent Ambo <tazjin@google.com> | 2020-05-18T01·34+0100 |
commit | 6dc6c29fa4a4ddd3bb72f8415fac5936d719bd44 (patch) | |
tree | 560a8389d1682465599d94193053811acfd5de37 /third_party/nix/src/libutil/archive.cc | |
parent | c584480cd46fb49e690e931f326472e512a82878 (diff) |
refactor(3p/nix/libutil): Replace internal logging library with glog r/754
Diffstat (limited to 'third_party/nix/src/libutil/archive.cc')
-rw-r--r-- | third_party/nix/src/libutil/archive.cc | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/third_party/nix/src/libutil/archive.cc b/third_party/nix/src/libutil/archive.cc index 9ae5c76db751..8f98a3daf301 100644 --- a/third_party/nix/src/libutil/archive.cc +++ b/third_party/nix/src/libutil/archive.cc @@ -10,6 +10,7 @@ #include <map> #include <vector> #include "config.hh" +#include "glog/logging.h" #include "util.hh" namespace nix { @@ -61,8 +62,9 @@ static void dump(const Path& path, Sink& sink, PathFilter& filter) { checkInterrupt(); struct stat st; - if (lstat(path.c_str(), &st)) + if (lstat(path.c_str(), &st)) { throw SysError(format("getting attributes of path '%1%'") % path); + } sink << "("; @@ -87,8 +89,9 @@ static void dump(const Path& path, Sink& sink, PathFilter& filter) { string name(i.name); size_t pos = i.name.find(caseHackSuffix); if (pos != string::npos) { - debug(format("removing case hack suffix from '%1%'") % - (path + "/" + i.name)); + DLOG(INFO) << "removing case hack suffix from " << path << "/" + << i.name; + name.erase(pos); } if (unhacked.find(name) != unhacked.end()) @@ -247,15 +250,17 @@ static void parse(ParseSink& sink, Source& source, const Path& path) { if (archiveSettings.useCaseHack) { auto i = names.find(name); if (i != names.end()) { - debug(format("case collision between '%1%' and '%2%'") % - i->first % name); + DLOG(INFO) << "case collision between '" << i->first << "' and '" + << name << "'"; name += caseHackSuffix; name += std::to_string(++i->second); } else names[name] = 0; } } else if (s == "node") { - if (s.empty()) throw badArchive("entry name missing"); + if (s.empty()) { + throw badArchive("entry name missing"); + } parse(sink, source, path + "/" + name); } else throw badArchive("unknown field " + s); |