aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/builtins
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstore/builtins')
-rw-r--r--src/libstore/builtins/buildenv.cc14
-rw-r--r--src/libstore/builtins/fetchurl.cc4
2 files changed, 9 insertions, 9 deletions
diff --git a/src/libstore/builtins/buildenv.cc b/src/libstore/builtins/buildenv.cc
index c8911d153..eb68d5a33 100644
--- a/src/libstore/builtins/buildenv.cc
+++ b/src/libstore/builtins/buildenv.cc
@@ -53,13 +53,13 @@ static void createLinks(State & state, const Path & srcDir, const Path & dstDir,
* Python package brings its own
* `$out/lib/pythonX.Y/site-packages/easy-install.pth'.)
*/
- if (hasSuffix(srcFile, "/propagated-build-inputs") ||
- hasSuffix(srcFile, "/nix-support") ||
- hasSuffix(srcFile, "/perllocal.pod") ||
- hasSuffix(srcFile, "/info/dir") ||
- hasSuffix(srcFile, "/log") ||
- hasSuffix(srcFile, "/manifest.nix") ||
- hasSuffix(srcFile, "/manifest.json"))
+ if (srcFile.ends_with("/propagated-build-inputs") ||
+ srcFile.ends_with("/nix-support") ||
+ srcFile.ends_with("/perllocal.pod") ||
+ srcFile.ends_with("/info/dir") ||
+ srcFile.ends_with("/log") ||
+ srcFile.ends_with("/manifest.nix") ||
+ srcFile.ends_with("/manifest.json"))
continue;
else if (S_ISDIR(srcSt.st_mode)) {
diff --git a/src/libstore/builtins/fetchurl.cc b/src/libstore/builtins/fetchurl.cc
index 7d7924d77..3d87bdc21 100644
--- a/src/libstore/builtins/fetchurl.cc
+++ b/src/libstore/builtins/fetchurl.cc
@@ -41,7 +41,7 @@ void builtinFetchurl(const BasicDerivation & drv, const std::string & netrcData)
request.decompress = false;
auto decompressor = makeDecompressionSink(
- unpack && hasSuffix(mainUrl, ".xz") ? "xz" : "none", sink);
+ unpack && mainUrl.ends_with(".xz") ? "xz" : "none", sink);
fileTransfer->download(std::move(request), *decompressor);
decompressor->finish();
});
@@ -62,7 +62,7 @@ void builtinFetchurl(const BasicDerivation & drv, const std::string & netrcData)
if (getAttr("outputHashMode") == "flat")
for (auto hashedMirror : settings.hashedMirrors.get())
try {
- if (!hasSuffix(hashedMirror, "/")) hashedMirror += '/';
+ if (!hashedMirror.ends_with("/")) hashedMirror += '/';
std::optional<HashType> ht = parseHashTypeOpt(getAttr("outputHashAlgo"));
Hash h = newHashAllowEmpty(getAttr("outputHash"), ht);
fetch(hashedMirror + printHashType(h.type) + "/" + h.to_string(Base16, false));