unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Andreas Enge <andreas@enge.fr>
To: bug-guix@gnu.org
Subject: More robust substitute*
Date: Sat, 2 Feb 2013 17:14:13 +0100	[thread overview]
Message-ID: <201302021714.13440.andreas@enge.fr> (raw)

[-- 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 --]

             reply	other threads:[~2013-02-02 16:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-02 16:14 Andreas Enge [this message]
2013-02-02 16:23 ` More robust substitute* 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201302021714.13440.andreas@enge.fr \
    --to=andreas@enge.fr \
    --cc=bug-guix@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).