diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2023-03-03 10:22:11 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-03 10:22:11 +0100 |
commit | f0908f592cd9d464368339618ffce952a532b3ec (patch) | |
tree | 869c0d7df9e5ee777132bdb21fed6ea5890f84b4 /src/libstore/gc.cc | |
parent | 28c3e4eb1d2609079a7efd72c39ed70fac7e614a (diff) | |
parent | 29abc8e7647cd9ec6ef5a1df3fcb1dcf4a4495a2 (diff) |
Merge pull request #7942 from edolstra/remove-format
Remove FormatOrString and remaining uses of format()
Diffstat (limited to 'src/libstore/gc.cc')
-rw-r--r-- | src/libstore/gc.cc | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/libstore/gc.cc b/src/libstore/gc.cc index 996f26a95..0aecc2d3b 100644 --- a/src/libstore/gc.cc +++ b/src/libstore/gc.cc @@ -34,8 +34,7 @@ static void makeSymlink(const Path & link, const Path & target) createDirs(dirOf(link)); /* Create the new symlink. */ - Path tempLink = (format("%1%.tmp-%2%-%3%") - % link % getpid() % random()).str(); + Path tempLink = fmt("%1%.tmp-%2%-%3%", link, getpid(), random()); createSymlink(target, tempLink); /* Atomically replace the old one. */ @@ -197,7 +196,7 @@ void LocalStore::findTempRoots(Roots & tempRoots, bool censor) pid_t pid = std::stoi(i.name); - debug(format("reading temporary root file '%1%'") % path); + debug("reading temporary root file '%1%'", path); AutoCloseFD fd(open(path.c_str(), O_CLOEXEC | O_RDWR, 0666)); if (!fd) { /* It's okay if the file has disappeared. */ @@ -263,7 +262,7 @@ void LocalStore::findRoots(const Path & path, unsigned char type, Roots & roots) target = absPath(target, dirOf(path)); if (!pathExists(target)) { if (isInDir(path, stateDir + "/" + gcRootsDir + "/auto")) { - printInfo(format("removing stale link from '%1%' to '%2%'") % path % target); + printInfo("removing stale link from '%1%' to '%2%'", path, target); unlink(path.c_str()); } } else { @@ -863,7 +862,7 @@ void LocalStore::collectGarbage(const GCOptions & options, GCResults & results) continue; } - printMsg(lvlTalkative, format("deleting unused link '%1%'") % path); + printMsg(lvlTalkative, "deleting unused link '%1%'", path); if (unlink(path.c_str()) == -1) throw SysError("deleting '%1%'", path); |