Fixes <http://bugs.gnu.org/18534>.
* guix/scripts/pull.scm (with-environment-variable, with-PATH): New
macros.
(temporary-directory, first-directory, interned-then-deleted): New
procedures.
(unpack): Rewrite to do the unpacking in the current process rather
than as a separate derivation.
(%self-build-file): New variable.
(build-from-source): New procedure.
(build-and-install): Use it.
* guix/build/pull.scm (build-guix): Rename 'tarball' argument to
'source'. Remove #:tar and #:gzip parameters, as well as 'tar'
invocation. Remove 'scandir' invocation. Wrap body in
'with-directory-excursion'.
* build-aux/build-self.scm: New file.
* Makefile.am (EXTRA_DIST): Add it.
* guix/build/pull.scm (report-build-progress): New procedure.
(p-for-each): Add #:progress parameter.
[loop]: Keep track of the number of completed processes. Tail-call
PROGRESS at each loop iteration.
(build-guix): Add #:debug-port parameter. Use it for verbose
messages. Change 'tar' flags to 'xf'. Around 'compile-file' call,
bind CURRENT-WARNING-PORT to DEBUG-PORT.
* guix/scripts/pull.scm (unpack): Add #:verbose? parameter.
[builder]: Pass #:debug-port to 'build-guix'.
(guix-pull): Leave CURRENT-BUILD-OUTPUT-PORT unchanged. Pass
#:verbose? to 'unpack'.