mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-26 17:03:01 +00:00
stdenv/check-meta: Don't create new environments when computing meta.repository
This commit is contained in:
parent
d5766175de
commit
f8b091d53f
@ -10,7 +10,9 @@ let
|
|||||||
concatMapStrings
|
concatMapStrings
|
||||||
concatMapStringsSep
|
concatMapStringsSep
|
||||||
concatStrings
|
concatStrings
|
||||||
|
filter
|
||||||
findFirst
|
findFirst
|
||||||
|
head
|
||||||
isDerivation
|
isDerivation
|
||||||
length
|
length
|
||||||
concatMap
|
concatMap
|
||||||
@ -436,6 +438,18 @@ let
|
|||||||
# -----
|
# -----
|
||||||
else { valid = "yes"; });
|
else { valid = "yes"; });
|
||||||
|
|
||||||
|
getRepository = let
|
||||||
|
getSrcs = attrs:
|
||||||
|
if attrs ? src
|
||||||
|
then
|
||||||
|
[ attrs.src ]
|
||||||
|
else
|
||||||
|
filter (src: src ? meta.homepage) attrs.srcs;
|
||||||
|
getHomePages = map (src: src.meta.homepage);
|
||||||
|
unlist = list:
|
||||||
|
if length list == 1 then head list
|
||||||
|
else list;
|
||||||
|
in attrs: unlist (getHomePages (getSrcs attrs));
|
||||||
|
|
||||||
# The meta attribute is passed in the resulting attribute set,
|
# The meta attribute is passed in the resulting attribute set,
|
||||||
# but it's not part of the actual derivation, i.e., it's not
|
# but it's not part of the actual derivation, i.e., it's not
|
||||||
@ -454,22 +468,7 @@ let
|
|||||||
# this could be handled a lot easier if we nulled it instead
|
# this could be handled a lot easier if we nulled it instead
|
||||||
# of having it be undefined, but that wouldn't match the
|
# of having it be undefined, but that wouldn't match the
|
||||||
# other attributes.
|
# other attributes.
|
||||||
repository = let
|
repository = getRepository attrs;
|
||||||
getSrcs = attrs:
|
|
||||||
if attrs ? src
|
|
||||||
then
|
|
||||||
[ attrs.src ]
|
|
||||||
else
|
|
||||||
lib.filter (src: src ? meta.homepage) attrs.srcs;
|
|
||||||
getHomePages = srcs: map (src: src.meta.homepage) srcs;
|
|
||||||
unlist = list:
|
|
||||||
if lib.length list == 1
|
|
||||||
then
|
|
||||||
lib.elemAt list 0
|
|
||||||
else
|
|
||||||
list;
|
|
||||||
in
|
|
||||||
unlist (getHomePages (getSrcs attrs));
|
|
||||||
} // {
|
} // {
|
||||||
# `name` derivation attribute includes cross-compilation cruft,
|
# `name` derivation attribute includes cross-compilation cruft,
|
||||||
# is under assert, and is sanitized.
|
# is under assert, and is sanitized.
|
||||||
|
Loading…
Reference in New Issue
Block a user