Commit Graph

13 Commits (dcd72906545816938d16af3afca0ffa9e4ce3dcf)

Author SHA1 Message Date
Ludovic Courtès dcd7290654 utils: Add `with-atomic-file-replacement'.
* guix/build/utils.scm (with-atomic-file-replacement): New procedure.
  (substitute): Use it.
2012-10-16 17:31:16 +02:00
Ludovic Courtès 9d9ef458e8 utils: Make `set-path-environment-variable' verbose.
* guix/build/utils.scm (set-path-environment-variable): Print ENV-VAR
  and its value.
2012-09-06 22:57:46 +02:00
Ludovic Courtès 8197c978ef utils: Change `substitute*' to allow iteration over several matches.
* guix/build/utils.scm (substitute): Do not pass the OUT to PROC; use
  `list-matches' instead of `regexp-exec' and pass a list of matches to
  PROC. Expect PROC to return a string, and output that.  Fold over
  RX+PROC in order.  Use `(read-line p 'concat)' to include the trailing
  delimiter in LINE.
  (substitute*): Produce code to iterate over the matches, and return a
  string, which includes anything from the original line that's in
  between matches.

* distro/base.scm (gcc-4.7, glibc): Adjust accordingly: remove use
  of (ice-9 regex) and `regexp-substitute/global'; return a string.
2012-09-01 19:21:31 +02:00
Ludovic Courtès 8773648e35 utils: Change `substitute*' to accept a list of files to patch.
* guix/build/utils.scm (substitute*): Support a list of files as the
  first argument.
2012-08-25 13:12:45 +02:00
Ludovic Courtès 525a59d6d3 utils: Add a `path' argument to `patch-shebang'.
* guix/build/utils.scm (patch-shebang): Add an optional `path'
  parameter.  Change SHEBANG-RX to match the whole interpreter file
  name.  Don't patch when BIN and CMD are the same.  Add docstring.
2012-08-19 23:04:03 +02:00
Ludovic Courtès ebe2f31f19 utils: Add `patch-shebang'.
* guix/build/utils.scm (search-path-as-string->list): New procedure.
  (dump-port, patch-shebang): New procedures.
2012-08-19 17:41:30 +02:00
Ludovic Courtès d9dbab18e2 utils: Have `substitute' restore the file's permission bits.
* guix/build/utils.scm (substitute): Restore FILE's mode before renaming
  TEMPLATE.
2012-07-07 18:11:52 +02:00
Ludovic Courtès 4fa697e932 utils: Change `substitute' and `substitute*' to work with several regexps.
* guix/build/utils.scm (substitute): Change to accept a `pattern+procs'
  parameter.  Iterate over it.
  (substitute*): Adjust accordingly.

* distro/base.scm (guile-1.8): Adjust accordingly.
2012-07-07 17:12:04 +02:00
Ludovic Courtès 10c87717bd utils: Introduce `substitute*', for easier sed-like syntax.
* guix/build/utils.scm (let-matches, substitute*): New macros.

* distro/base.scm (guile-1.8): Use `substitute*' instead of
  `substitute'.  Remove the #:modules argument.
2012-07-07 16:25:10 +02:00
Ludovic Courtès 8e6ecb1400 utils: Make sure `substitute' writes all its output.
* guix/build/utils.scm (substitute): Close OUT before renaming it.
2012-07-06 00:51:55 +02:00
Ludovic Courtès b0e0d0e99f Add builder-side utilities for phases, stream editing, & co.
* guix/build/utils.scm (with-directory-excursion): New macro.
  (alist-cons-before, alist-cons-after, alist-replace): New procedures.
  (substitute): New procedure.

* tests/build-utils.scm: New file.

* Makefile.am (TESTS): Add `tests/build-utils.scm'.
2012-07-05 00:13:30 +02:00
Ludovic Courtès 9f55cf8d56 Remove leftover debugging expressions.
* guix/build/utils.scm (directory-exists?): Remove leftover debugging
  expressions.
2012-06-16 16:16:16 +02:00
Ludovic Courtès c36db98c8e Add supporting tools for the GNU Build System.
* guix/derivations.scm (build-expression->derivation): Add all of INPUTS
  as inputs to the final derivation.

* guix/build/gnu-build-system.scm, guix/build/utils.scm,
  guix/gnu-build-system.scm: New files.

* tests/builders.scm ("gnu-build"): New test.
2012-06-13 17:03:34 +02:00