utils: Change `substitute*' to allow iteration over several matches.
authorLudovic Courtès <ludo@gnu.org>
Sat, 1 Sep 2012 17:21:06 +0000 (19:21 +0200)
committerLudovic Courtès <ludo@gnu.org>
Sat, 1 Sep 2012 17:21:31 +0000 (19:21 +0200)
commit8197c978efb3fff61db42e80dd7358e7ee15bf20
treee3fb53962dc1cf64d4fd2243474e04b8c6505e4a
parent9dd036f35c9a825c30aecc9eb3a3f6266481cfe3
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.
distro/base.scm
guix/build/utils.scm