From 89eda326f8cf3afc8f83a1bdb2664cc10b58f279 Mon Sep 17 00:00:00 2001 From: Eman Resu Date: Mon, 20 Jul 2026 09:56:59 -0400 Subject: [PATCH] lib/sources: partially apply removeSuffix --- lib/sources.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/sources.nix b/lib/sources.nix index 9846e9c586f7..bc9f1c8f87e5 100644 --- a/lib/sources.nix +++ b/lib/sources.nix @@ -34,6 +34,8 @@ let pathIsRegularFile ; + removeSlashSuffix = removeSuffix "/"; + /** A basic filter for `cleanSourceWith` that removes directories of version control system, backup files (`*~`) @@ -362,7 +364,7 @@ let gitDir = absolutePath (dirOf path) (head m); commonDir'' = if pathIsRegularFile "${gitDir}/commondir" then fileContents "${gitDir}/commondir" else gitDir; - commonDir' = removeSuffix "/" commonDir''; + commonDir' = removeSlashSuffix commonDir''; commonDir = absolutePath gitDir commonDir'; refFile = removePrefix "${commonDir}/" "${gitDir}/${file}"; in @@ -460,7 +462,7 @@ let urlToName = url: let - base = baseNameOf (removeSuffix "/" (last (splitString ":" (toString url)))); + base = baseNameOf (removeSlashSuffix (last (splitString ":" (toString url)))); # chop away one git or archive-related extension removeExt = name: