profiles: Gracefully deal with packages containing an etc/ symlink.
authorLudovic Courtès <ludo@gnu.org>
Mon, 18 May 2015 07:47:29 +0000 (09:47 +0200)
committerLudovic Courtès <ludo@gnu.org>
Mon, 18 May 2015 07:47:29 +0000 (09:47 +0200)
commit113c17a0c969e600023698ae3a34994a796d0046
tree6a1102219aa229f3b4ac08d59806b21aa8acbb23
parent01dbc7e01a576bf388914dfe99fa473e87728462
profiles: Gracefully deal with packages containing an etc/ symlink.

This fixes a bug whereby 'guix package -i gcc-toolchain' would fail in
'build-profile'.  This is because in 'gcc-toolchain', etc/ is a symlink,
and so the 'scandir' call in 'unsymlink' would return #f instead of
returning a list.

Reported by Andreas Enge <andreas.enge@inria.fr>.

* guix/build/profiles.scm (ensure-writable-directory)[unsymlink]: Append
  "/" to TARGET before calling 'scandir'.
* tests/profiles.scm ("etc/profile when etc/ is a symlink"): New test.
guix/build/profiles.scm
tests/profiles.scm