mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-27 05:43:50 +03:00
lib/strings: deprecate readPathsFromFile
> NOTE: This function is not performant and should be avoided. It's not used at all in-tree now, so we can remove it completely after any remaining users are given notice.
This commit is contained in:
parent
79921889a0
commit
423fc3f232
@ -689,14 +689,15 @@ rec {
|
|||||||
"/prefix/nix-profiles-library-paths.patch"
|
"/prefix/nix-profiles-library-paths.patch"
|
||||||
"/prefix/compose-search-path.patch" ]
|
"/prefix/compose-search-path.patch" ]
|
||||||
*/
|
*/
|
||||||
readPathsFromFile = rootPath: file:
|
readPathsFromFile = lib.warn "lib.readPathsFromFile is deprecated, use a list instead"
|
||||||
let
|
(rootPath: file:
|
||||||
lines = lib.splitString "\n" (builtins.readFile file);
|
let
|
||||||
removeComments = lib.filter (line: line != "" && !(lib.hasPrefix "#" line));
|
lines = lib.splitString "\n" (builtins.readFile file);
|
||||||
relativePaths = removeComments lines;
|
removeComments = lib.filter (line: line != "" && !(lib.hasPrefix "#" line));
|
||||||
absolutePaths = builtins.map (path: rootPath + "/${path}") relativePaths;
|
relativePaths = removeComments lines;
|
||||||
in
|
absolutePaths = builtins.map (path: rootPath + "/${path}") relativePaths;
|
||||||
absolutePaths;
|
in
|
||||||
|
absolutePaths);
|
||||||
|
|
||||||
/* Read the contents of a file removing the trailing \n
|
/* Read the contents of a file removing the trailing \n
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user