* guix/build/profiles.scm (ensure-writable-directory): Export.
* guix/profiles.scm (gtk-icon-themes)[build]: Remove '@@' form and use (guix
build profiles).
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.
Reported by 宋文武 <iyzsong@gmail.com>.
* guix/build/profiles.scm (build-etc/profile,
ensure-writable-directory): New procedures.
(build-profile): Use them.
* tests/profiles.scm ("etc/profile when etc/ already exists"): New test.
* guix/build/profiles.scm: New file.
* Makefile.am (MODULES): Add it.
* guix/profiles.scm (profile-derivation)[builder]: Call out to
'build-profile'.
Add (guix build profiles) to the #:modules argument.