0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 03:52:22 +02:00

osxbundle: don't use sed but pure python

GNU sed and BSD sed don't share the same options for editing files in-place,
so a workaround is needed.

The most simple way is to use a pure python implementation of applying the
changes.
This commit is contained in:
Mihai Moldovan 2014-12-13 01:29:57 +01:00 committed by Stefano Pigozzi
parent 8c3dc7334b
commit 8c927376a1

View File

@ -3,6 +3,7 @@
import os
import shutil
import sys
import fileinput
from optparse import OptionParser
def sh(command):
@ -35,7 +36,8 @@ def copy_binary(binary_name):
shutil.copy(binary_name, target_binary(binary_name))
def apply_plist_template(plist_file, version):
sh("sed -i -e 's/${VERSION}/%s/g' %s" % (version, plist_file))
for line in fileinput.input(plist_file, inplace=1):
print (line.rstrip().replace('${VERSION}', version))
def main():
version = sh("./version.sh --print").strip()