From 51c98619c8d039b4cf459910a3a934637cb69e05 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Sun, 16 Dec 2012 10:56:25 +0100 Subject: osxbundle: print meaningful error when a dylib is missing If one of the bundled libraries is pointing to a missing dylib stop the bundling and exit with an error. This can happen if the user uninstalled a dependency after he built the binary/libraries. --- TOOLS/osxbundle.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'TOOLS/osxbundle.py') diff --git a/TOOLS/osxbundle.py b/TOOLS/osxbundle.py index d0c4b7e62b..8005f8c8c4 100755 --- a/TOOLS/osxbundle.py +++ b/TOOLS/osxbundle.py @@ -64,7 +64,13 @@ def run_install_name_tool(target_file, dylib_path, dest_dir, root=True): def cp_dylibs(target_file, dest_dir): for dylib_path in user_dylib_lst(target_file): dylib_dest_path = os.path.join(dest_dir, os.path.basename(dylib_path)) - shutil.copy(dylib_path, dylib_dest_path) + + try: + shutil.copy(dylib_path, dylib_dest_path) + except IOError: + sys.exit("%s uses library %s which is not available anymore" % \ + (target_file, dylib_path) ) + os.chmod(dylib_dest_path, 0o755) cp_dylibs(dylib_dest_path, dest_dir) -- cgit v1.2.3