symlinkJoin: support __structuredAttrs (#510526)
This commit is contained in:
@@ -573,7 +573,10 @@ rec {
|
||||
paths = mapPaths (path: "${path}${stripPrefix}") paths;
|
||||
buildCommand = ''
|
||||
mkdir -p $out
|
||||
for i in $(cat $pathsPath); do
|
||||
if [ -n "''${pathsPath:-}" ] && [ -f "$pathsPath" ]; then
|
||||
mapfile -d " " -t paths < "$pathsPath"
|
||||
fi
|
||||
for i in "''${paths[@]}"; do
|
||||
${optionalString (!failOnMissing) "if test -d $i; then "}${lndir}/bin/lndir -silent $i $out${
|
||||
optionalString (!failOnMissing) "; fi"
|
||||
}
|
||||
|
||||
@@ -55,6 +55,24 @@ in
|
||||
'';
|
||||
};
|
||||
|
||||
symlinkJoin-structured-attrs = testEqualContents {
|
||||
assertion = "symlinkJoin-structured-attrs";
|
||||
actual = symlinkJoin {
|
||||
__structuredAttrs = true;
|
||||
name = "symlinkJoin-structured-attrs";
|
||||
paths = [
|
||||
foo
|
||||
bar
|
||||
baz
|
||||
];
|
||||
};
|
||||
expected = runCommand "symlinkJoin-foo-bar-baz" { } ''
|
||||
mkdir -p $out/{var/lib/arbitrary,etc/test.d}
|
||||
ln -s {${foo},${bar}}/etc/test.d/* $out/etc/test.d
|
||||
ln -s ${baz}/var/lib/arbitrary/baz $out/var/lib/arbitrary/
|
||||
'';
|
||||
};
|
||||
|
||||
symlinkJoin-strip-paths = testEqualContents {
|
||||
assertion = "symlinkJoin-strip-paths";
|
||||
actual = symlinkJoin {
|
||||
|
||||
Reference in New Issue
Block a user