summaryrefslogtreecommitdiff
path: root/sys/src/cmd/python/Tools/scripts/fixps.py
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2021-06-14 00:00:37 +0000
committerOri Bernstein <ori@eigenstate.org>2021-06-14 00:00:37 +0000
commita73a964e51247ed169d322c725a3a18859f109a3 (patch)
tree3f752d117274d444bda44e85609aeac1acf313f3 /sys/src/cmd/python/Tools/scripts/fixps.py
parente64efe273fcb921a61bf27d33b230c4e64fcd425 (diff)
python, hg: tow outside the environment.
they've served us well, and can ride off into the sunset.
Diffstat (limited to 'sys/src/cmd/python/Tools/scripts/fixps.py')
-rwxr-xr-xsys/src/cmd/python/Tools/scripts/fixps.py33
1 files changed, 0 insertions, 33 deletions
diff --git a/sys/src/cmd/python/Tools/scripts/fixps.py b/sys/src/cmd/python/Tools/scripts/fixps.py
deleted file mode 100755
index 2ff15f41e..000000000
--- a/sys/src/cmd/python/Tools/scripts/fixps.py
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/usr/bin/env python
-
-# Fix Python script(s) to reference the interpreter via /usr/bin/env python.
-# Warning: this overwrites the file without making a backup.
-
-import sys
-import re
-
-
-def main():
- for filename in sys.argv[1:]:
- try:
- f = open(filename, 'r')
- except IOError, msg:
- print filename, ': can\'t open :', msg
- continue
- line = f.readline()
- if not re.match('^#! */usr/local/bin/python', line):
- print filename, ': not a /usr/local/bin/python script'
- f.close()
- continue
- rest = f.read()
- f.close()
- line = re.sub('/usr/local/bin/python',
- '/usr/bin/env python', line)
- print filename, ':', repr(line)
- f = open(filename, "w")
- f.write(line)
- f.write(rest)
- f.close()
-
-if __name__ == '__main__':
- main()