unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* More robust substitute*
@ 2013-02-02 16:14 Andreas Enge
  2013-02-02 16:23 ` Ludovic Courtès
  0 siblings, 1 reply; 5+ messages in thread
From: Andreas Enge @ 2013-02-02 16:14 UTC (permalink / raw)
  To: bug-guix

[-- Attachment #1: Type: text/plain, Size: 2932 bytes --]

Hello,

in texlive, there are lots of scripts to be installed in share; thus, the 
patch-shebang phase does not catch them. I tried the following:

   (substitute* (find-files "." "")
     (("^#!/bin/sh") (string-append "#!" (which "bash"))))

This chokes on binary files, in this case on a "Compiled terminfo entry" 
with the following message:
...
In unknown file:
   ?: 1 [regexp-exec # ...]
In ice-9/boot-9.scm:
 106: 0 [#<procedure 2a43840 at ice-9/boot-9.scm:97:6 (thrown-k . args)> 
misc-error ...]

ice-9/boot-9.scm:106:20: In procedure #<procedure 2a43840 at 
ice-9/boot-9.scm:97:6 (thrown-k . args)>:
ice-9/boot-9.scm:106:20: string contains #\nul character: "\x1a\x01!
\x00%\x00!\x00\x82\x016\x01vt100|vt100-am|vt100am|DEC 
vt100\x00\x00\x01\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00P\x00\b\x00\x18\x00ÿÿÿÿÿÿ\x03\x00ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ!
\x005\x007\x00.\x01-\x00\x91\x00ÿÿÿÿÿÿk\x00S\x00\x95\x00ÿÿH\x00ÿÿÿÿ^\x00ÿÿ|
\x00ÿÿ\x89\x00ÿÿÿÿÿÿÿÿ#\x00(\x00ÿÿÿÿÿÿÿÿÿÿÿÿÅ\x00$\x01)\x01ÿÿÿÿ\x18\x01ÿÿ\x8d\x00ÿÿñ\x00õ\x00ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ\xa0\x00ÿÿÿÿÿÿÿÿÿÿ¦\x00ÿÿÿÿÿÿÿÿ²\x00ÿÿ¶\x00º\x00¾\x00ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¢\x00ÿÿÿÿÿÿª\x00ÿÿÿÿÿÿ®\x00é\x00\x1c\x01ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ3\x01ÿÿÿÿÿÿU\x00ÿÿÿÿÿÿJ\x00b\x00ÿÿ\x80\x00ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿù\x00ÿÿÊ\x00Â\x00ÿÿ\x15\x01\x9e\x00æ\x00ÿÿ\x9b\x00ÿÿ\x99\x00ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿvt100|
vt100-am|vt100am|DEC 
vt100\x00\a\x00\x1b[5m\x00\x1b[1m\x00\x1b[H\x1b[2J\x00\r\x00\x1b[%i%p1%d;
%p2%dr\x00\b\x00\x1b[%p1%dD\x00\n"

Would there be a way to make this more robust? Or to obtain a "find-file" 
that returns only text files?

Andreas

[-- Attachment #2: Type: text/html, Size: 6401 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-02-03 18:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-02 16:14 More robust substitute* Andreas Enge
2013-02-02 16:23 ` Ludovic Courtès
2013-02-02 17:22   ` Andreas Enge
2013-02-03 17:56     ` Ludovic Courtès
2013-02-03 18:03       ` Andreas Enge

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).