Mon, 19 Aug 2019 12:22:08 +0200
install.py: fixed an issue causing installation to fail in certain situations on macOS.
scripts/install.py | file | annotate | diff | comparison | revisions |
--- a/scripts/install.py Sat Aug 03 14:42:15 2019 +0200 +++ b/scripts/install.py Mon Aug 19 12:22:08 2019 +0200 @@ -1179,7 +1179,7 @@ """ global cfg, macAppBundleName, macPythonExe, macAppBundlePath, pyqtVariant - dirs = { + directories = { "contents": "{0}/{1}/Contents/".format( macAppBundlePath, macAppBundleName), "exe": "{0}/{1}/Contents/MacOS".format( @@ -1187,17 +1187,17 @@ "icns": "{0}/{1}/Contents/Resources".format( macAppBundlePath, macAppBundleName) } - os.makedirs(dirs["contents"]) - os.makedirs(dirs["exe"]) - os.makedirs(dirs["icns"]) + for directory in directories: + if not os.path.exists(directory): + os.makedirs(directory) if macPythonExe == defaultMacPythonExe: - starter = os.path.join(dirs["exe"], "eric") + starter = os.path.join(directories["exe"], "eric") os.symlink(macPythonExe, starter) else: starter = "python{0}".format(sys.version_info.major) - wname = os.path.join(dirs["exe"], "eric6") + wname = os.path.join(directories["exe"], "eric6") # determine entry for DYLD_FRAMEWORK_PATH dyldLine = "" @@ -1235,7 +1235,7 @@ os.chmod(wname, 0o755) shutilCopy(os.path.join(eric6SourceDir, "pixmaps", "eric_2.icns"), - os.path.join(dirs["icns"], "eric.icns")) + os.path.join(directories["icns"], "eric.icns")) if os.path.exists(os.path.join("eric", "eric6", "UI", "Info.py")): # Installing from archive @@ -1248,7 +1248,7 @@ CopyrightShort = "(c) 2002 - 2019 Detlev Offenbach" copyToFile( - os.path.join(dirs["contents"], "Info.plist"), + os.path.join(directories["contents"], "Info.plist"), '''<?xml version="1.0" encoding="UTF-8"?>\n''' '''<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"\n''' ''' "http://www.apple.com/DTDs/PropertyList-1.0.dtd">\n'''