diff options
author | John Ericson <John.Ericson@Obsidian.Systems> | 2020-03-28 23:22:10 +0000 |
---|---|---|
committer | John Ericson <git@JohnEricson.me> | 2020-03-29 11:23:15 -0400 |
commit | 87b32bab05ff91981c8847d66cd5502feb44f3b5 (patch) | |
tree | ff77f6703185a8b9544f354de5853254ef88a4d8 /src/libexpr/primops | |
parent | eb1911e277bfcc1b161cb996205ae1696f496099 (diff) |
Use `enum struct` and drop prefixes
This does a few enums; the rest will be gotten in subsequent commits.
Diffstat (limited to 'src/libexpr/primops')
-rw-r--r-- | src/libexpr/primops/fetchGit.cc | 8 | ||||
-rw-r--r-- | src/libexpr/primops/fetchMercurial.cc | 10 |
2 files changed, 9 insertions, 9 deletions
diff --git a/src/libexpr/primops/fetchGit.cc b/src/libexpr/primops/fetchGit.cc index 4aee1073e..7f70dfab0 100644 --- a/src/libexpr/primops/fetchGit.cc +++ b/src/libexpr/primops/fetchGit.cc @@ -69,7 +69,7 @@ GitInfo exportGit(ref<Store> store, const std::string & uri, return files.count(file); }; - gitInfo.storePath = store->printStorePath(store->addToStore("source", uri, true, htSHA256, filter)); + gitInfo.storePath = store->printStorePath(store->addToStore("source", uri, true, HashType::SHA256, filter)); return gitInfo; } @@ -86,7 +86,7 @@ GitInfo exportGit(ref<Store> store, const std::string & uri, deletePath(getCacheDir() + "/nix/git"); - Path cacheDir = getCacheDir() + "/nix/gitv2/" + hashString(htSHA256, uri).to_string(Base32, false); + Path cacheDir = getCacheDir() + "/nix/gitv2/" + hashString(HashType::SHA256, uri).to_string(Base::Base32, false); if (!pathExists(cacheDir)) { createDirs(dirOf(cacheDir)); @@ -123,7 +123,7 @@ GitInfo exportGit(ref<Store> store, const std::string & uri, } if (doFetch) { - Activity act(*logger, lvlTalkative, actUnknown, fmt("fetching Git repository '%s'", uri)); + Activity act(*logger, Verbosity::Talkative, ActivityType::Unknown, fmt("fetching Git repository '%s'", uri)); // FIXME: git stderr messes up our progress indicator, so // we're using --quiet for now. Should process its stderr. @@ -145,7 +145,7 @@ GitInfo exportGit(ref<Store> store, const std::string & uri, printTalkative("using revision %s of repo '%s'", gitInfo.rev, uri); - std::string storeLinkName = hashString(htSHA512, name + std::string("\0"s) + gitInfo.rev).to_string(Base32, false); + std::string storeLinkName = hashString(HashType::SHA512, name + std::string("\0"s) + gitInfo.rev).to_string(Base::Base32, false); Path storeLink = cacheDir + "/" + storeLinkName + ".link"; PathLocks storeLinkLock({storeLink}, fmt("waiting for lock on '%1%'...", storeLink)); // FIXME: broken diff --git a/src/libexpr/primops/fetchMercurial.cc b/src/libexpr/primops/fetchMercurial.cc index db274fa4f..65f52f682 100644 --- a/src/libexpr/primops/fetchMercurial.cc +++ b/src/libexpr/primops/fetchMercurial.cc @@ -63,7 +63,7 @@ HgInfo exportMercurial(ref<Store> store, const std::string & uri, return files.count(file); }; - hgInfo.storePath = store->printStorePath(store->addToStore("source", uri, true, htSHA256, filter)); + hgInfo.storePath = store->printStorePath(store->addToStore("source", uri, true, HashType::SHA256, filter)); return hgInfo; } @@ -71,9 +71,9 @@ HgInfo exportMercurial(ref<Store> store, const std::string & uri, if (rev == "") rev = "default"; - Path cacheDir = fmt("%s/nix/hg/%s", getCacheDir(), hashString(htSHA256, uri).to_string(Base32, false)); + Path cacheDir = fmt("%s/nix/hg/%s", getCacheDir(), hashString(HashType::SHA256, uri).to_string(Base::Base32, false)); - Path stampFile = fmt("%s/.hg/%s.stamp", cacheDir, hashString(htSHA512, rev).to_string(Base32, false)); + Path stampFile = fmt("%s/.hg/%s.stamp", cacheDir, hashString(HashType::SHA512, rev).to_string(Base::Base32, false)); /* If we haven't pulled this repo less than ‘tarball-ttl’ seconds, do so now. */ @@ -90,7 +90,7 @@ HgInfo exportMercurial(ref<Store> store, const std::string & uri, RunOptions("hg", { "log", "-R", cacheDir, "-r", rev, "--template", "1" }) .killStderr(true)).second == "1")) { - Activity act(*logger, lvlTalkative, actUnknown, fmt("fetching Mercurial repository '%s'", uri)); + Activity act(*logger, Verbosity::Talkative, ActivityType::Unknown, fmt("fetching Mercurial repository '%s'", uri)); if (pathExists(cacheDir)) { try { @@ -124,7 +124,7 @@ HgInfo exportMercurial(ref<Store> store, const std::string & uri, hgInfo.revCount = std::stoull(tokens[1]); hgInfo.branch = tokens[2]; - std::string storeLinkName = hashString(htSHA512, name + std::string("\0"s) + hgInfo.rev).to_string(Base32, false); + std::string storeLinkName = hashString(HashType::SHA512, name + std::string("\0"s) + hgInfo.rev).to_string(Base::Base32, false); Path storeLink = fmt("%s/.hg/%s.link", cacheDir, storeLinkName); try { |