mirror of
https://github.com/mpv-player/mpv
synced 2024-12-22 14:52:43 +00:00
osxbundle: suggest some ways to correct missing dependencies
Hopefully this can give some more clues to users about what broke if they find themselves in this situation.
This commit is contained in:
parent
588eef86c2
commit
0a1c497945
@ -5,6 +5,7 @@ import re
|
|||||||
import shutil
|
import shutil
|
||||||
import sys
|
import sys
|
||||||
from optparse import OptionParser
|
from optparse import OptionParser
|
||||||
|
from textwrap import dedent
|
||||||
|
|
||||||
def sh(command):
|
def sh(command):
|
||||||
return os.popen(command).read()
|
return os.popen(command).read()
|
||||||
@ -69,8 +70,16 @@ def cp_dylibs(target_file, dest_dir):
|
|||||||
try:
|
try:
|
||||||
shutil.copy(dylib_path, dylib_dest_path)
|
shutil.copy(dylib_path, dylib_dest_path)
|
||||||
except IOError:
|
except IOError:
|
||||||
sys.exit("%s uses library %s which is not available anymore" % \
|
if re.match("dylib$", target_file):
|
||||||
(target_file, dylib_path) )
|
reinstall_what = target_file
|
||||||
|
else:
|
||||||
|
reinstall_what = dylib_path
|
||||||
|
|
||||||
|
sys.exit(dedent("""\
|
||||||
|
%s uses library %s which is not available anymore.
|
||||||
|
This is most likely because you uninstalled %s.
|
||||||
|
Please reinstall %s to fix it's dependencies.""" % \
|
||||||
|
(target_file, dylib_path, dylib_path, reinstall_what) ))
|
||||||
|
|
||||||
os.chmod(dylib_dest_path, 0o755)
|
os.chmod(dylib_dest_path, 0o755)
|
||||||
cp_dylibs(dylib_dest_path, dest_dir)
|
cp_dylibs(dylib_dest_path, dest_dir)
|
||||||
|
Loading…
Reference in New Issue
Block a user