mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-30 01:26:15 +02:00
Don't chmod symlink before moving outputs around
Co-authored-by: Théophane Hufschmitt <regnat@users.noreply.github.com>
This commit is contained in:
parent
b99062b023
commit
c9f1ed912c
2 changed files with 11 additions and 3 deletions
|
@ -4101,6 +4101,11 @@ void DerivationGoal::registerOutputs()
|
||||||
if (lstat(actualPath.c_str(), &st))
|
if (lstat(actualPath.c_str(), &st))
|
||||||
throw SysError("getting attributes of path '%1%'", actualPath);
|
throw SysError("getting attributes of path '%1%'", actualPath);
|
||||||
mode |= 0200;
|
mode |= 0200;
|
||||||
|
/* Try to change the perms, but only if the file isn't a
|
||||||
|
symlink as symlinks permissions are mostly ignored and
|
||||||
|
calling `chmod` on it will just forward the call to the
|
||||||
|
target of the link. */
|
||||||
|
if (!S_ISLNK(st.st_mode))
|
||||||
if (chmod(actualPath.c_str(), mode) == -1)
|
if (chmod(actualPath.c_str(), mode) == -1)
|
||||||
throw SysError("changing mode of '%1%' to %2$o", actualPath, mode);
|
throw SysError("changing mode of '%1%' to %2$o", actualPath, mode);
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,11 +16,14 @@ rec {
|
||||||
};
|
};
|
||||||
rootCA = mkDerivation {
|
rootCA = mkDerivation {
|
||||||
name = "dependent";
|
name = "dependent";
|
||||||
|
outputs = [ "out" "dev" ];
|
||||||
buildCommand = ''
|
buildCommand = ''
|
||||||
echo "building a CA derivation"
|
echo "building a CA derivation"
|
||||||
echo "The seed is ${toString seed}"
|
echo "The seed is ${toString seed}"
|
||||||
mkdir -p $out
|
mkdir -p $out
|
||||||
echo ${rootLegacy}/hello > $out/dep
|
echo ${rootLegacy}/hello > $out/dep
|
||||||
|
# test symlink at root
|
||||||
|
ln -s $out $dev
|
||||||
'';
|
'';
|
||||||
__contentAddressed = true;
|
__contentAddressed = true;
|
||||||
outputHashMode = "recursive";
|
outputHashMode = "recursive";
|
||||||
|
|
Loading…
Reference in a new issue