From f72206b736e4fa1be010a05aa12fa57afea2019c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Forsman?= Date: Mon, 27 Feb 2017 10:09:48 +0100 Subject: unpack-channel.nix: fix 'mv' corner case unpack-channel.nix fails if the tarball contains a directory named the same as the channel: mv: cannot move 'nixpkgs' to a subdirectory of itself, '.../nixpkgs' This commit fixes that by not moving the directory if it already has the correct name. --- corepkgs/unpack-channel.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/corepkgs/unpack-channel.nix b/corepkgs/unpack-channel.nix index 9445532de..a654db40e 100644 --- a/corepkgs/unpack-channel.nix +++ b/corepkgs/unpack-channel.nix @@ -15,7 +15,9 @@ let else ${bzip2} -d < $src | ${tar} xf - ${tarFlags} fi - mv * $out/$channelName + if [ * != $channelName ]; then + mv * $out/$channelName + fi if [ -n "$binaryCacheURL" ]; then mkdir $out/binary-caches echo -n "$binaryCacheURL" > $out/binary-caches/$channelName -- cgit v1.2.3