changeset 2948:f6ba638a6ca7

read header explicitly iso. reading file pipe; the latter truncates the interpreter name. This fixes .py scripts for mingw
author hanwen <hanwen@lilypond.org>
date Wed, 29 Nov 2006 00:45:49 +0100
parents d064501a05ff
children a9d953a52fe2
files specs/lilypond.py
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/specs/lilypond.py	Mon Nov 27 17:23:18 2006 +0100
+++ b/specs/lilypond.py	Wed Nov 29 00:45:49 2006 +0100
@@ -413,10 +413,10 @@
 ''')
         import glob
         for i in glob.glob (self.expand ('%(install_root)s/usr/bin/*')):
-            s = self.read_pipe ('file %(i)s' % locals ())
-            if s.find ('guile') >= 0:
+            header = open (i).readline().strip ()
+            if header.endswith ('guile'):
                 self.system ('mv %(i)s %(i)s.scm', locals ())
-            elif s.find ('python') >= 0 and not i.endswith ('.py'):
+            elif header.endswith ('python') and not i.endswith ('.py'):
                 self.system ('mv %(i)s %(i)s.py', locals ())
 
         for i in self.locate_files ('%(install_root)s', "*.ly"):