summary refs log tree commit diff
path: root/pkgs/build-support/fetchzip/default.nix
diff options
context:
space:
mode:
authorJan Malakhovski <oxij@oxij.org>2021-02-04 14:48:47 +0000
committerJan Malakhovski <oxij@oxij.org>2021-02-04 14:48:47 +0000
commitdcb6103bf2d6bcb9bac2b86aef3a9a4a39e37f6d (patch)
treecddb8c30e7824605aeb115032fe059ae10f351d5 /pkgs/build-support/fetchzip/default.nix
parent84d3739ed6893cb9b9e350636d74959cf437fac9 (diff)
downloadnixpkgs-dcb6103bf2d6bcb9bac2b86aef3a9a4a39e37f6d.tar
nixpkgs-dcb6103bf2d6bcb9bac2b86aef3a9a4a39e37f6d.tar.gz
nixpkgs-dcb6103bf2d6bcb9bac2b86aef3a9a4a39e37f6d.tar.bz2
nixpkgs-dcb6103bf2d6bcb9bac2b86aef3a9a4a39e37f6d.tar.lz
nixpkgs-dcb6103bf2d6bcb9bac2b86aef3a9a4a39e37f6d.tar.xz
nixpkgs-dcb6103bf2d6bcb9bac2b86aef3a9a4a39e37f6d.tar.zst
nixpkgs-dcb6103bf2d6bcb9bac2b86aef3a9a4a39e37f6d.zip
fetchzip: fix `extraPostFetch` concatenation
4a5c49363a58e711c2016b9ebb6f642e3c9c1be5 added some more commands after
`extraPostFetch` but concatenated them without a separating newline.

Which means, that since that commit

  fetchzip { ..., extraPostFetch = ''rm -f "$out"/some-file''; }

now actually runs the following shell command

  rm -f "$out"/some-file"chmod -R a-w "$out"

thus deleting "$out". Which is very unfortunate.

Especially since this actually happens on master for all `fetchFromBitbucket`
derivations. But since the results are fixed-output users bulding with hydra
cache enabled are not hitting this for not recently updated derivations yet.
Diffstat (limited to 'pkgs/build-support/fetchzip/default.nix')
-rw-r--r--pkgs/build-support/fetchzip/default.nix19
1 files changed, 10 insertions, 9 deletions
diff --git a/pkgs/build-support/fetchzip/default.nix b/pkgs/build-support/fetchzip/default.nix
index a1744b48deb..d2f3bb48bbc 100644
--- a/pkgs/build-support/fetchzip/default.nix
+++ b/pkgs/build-support/fetchzip/default.nix
@@ -45,16 +45,17 @@
     '' else ''
       mv "$unpackDir" "$out"
     '')
-    + extraPostFetch
-    # Remove write permissions for files unpacked with write bits set
-    # Fixes https://github.com/NixOS/nixpkgs/issues/38649
-    #
-    # However, we should (for the moment) retain write permission on the directory
-    # itself, to avoid tickling https://github.com/NixOS/nix/issues/4295 in
-    # single-user Nix installations. This is because in sandbox mode we'll try to
-    # move the path, and if we don't have write permissions on the directory,
-    # then we can't update the ".." entry.
     + ''
+      ${extraPostFetch}
+
+      # Remove write permissions for files unpacked with write bits set
+      # Fixes https://github.com/NixOS/nixpkgs/issues/38649
+      #
+      # However, we should (for the moment) retain write permission on the directory
+      # itself, to avoid tickling https://github.com/NixOS/nix/issues/4295 in
+      # single-user Nix installations. This is because in sandbox mode we'll try to
+      # move the path, and if we don't have write permissions on the directory,
+      # then we can't update the ".." entry.
       chmod -R a-w "$out"
       chmod u+w "$out"
     '';