438 else os.path.join(sourceDir, "src", "eric7") |
438 else os.path.join(sourceDir, "src", "eric7") |
439 ) |
439 ) |
440 |
440 |
441 # cleanup source if installing from source |
441 # cleanup source if installing from source |
442 if installFromSource: |
442 if installFromSource: |
443 print("Cleaning up source ...", end="") |
443 print("Cleaning up source ...", end="", flush=True) |
444 cleanupSource(os.path.join(eric7SourceDir, "DebugClients")) |
444 cleanupSource(os.path.join(eric7SourceDir, "DebugClients")) |
445 print(" Done") |
445 print(" Done") |
446 |
446 |
447 # cleanup old installation |
447 # cleanup old installation |
448 try: |
448 try: |
449 if doCleanup: |
449 if doCleanup: |
450 print("Cleaning up old installation ...", end="") |
450 print("Cleaning up old installation ...", end="", flush=True) |
451 if distDir: |
451 if distDir: |
452 shutil.rmtree(distDir, True) |
452 shutil.rmtree(distDir, True) |
453 else: |
453 else: |
454 cleanUp() |
454 cleanUp() |
455 print(" Done") |
455 print(" Done") |
456 except OSError as msg: |
456 except OSError as msg: |
457 sys.stderr.write("Error: {0}\nTry install as root.\n".format(msg)) |
457 sys.stderr.write("Error: {0}\nTry install as root.\n".format(msg)) |
458 exit(7) |
458 exit(7) |
459 |
459 |
460 if doCompile: |
460 if doCompile: |
461 print("Compiling source files ...", end="") |
461 print("Compiling source files ...", end="", flush=True) |
462 skipRe = re.compile(r"DebugClients[\\/]Python[\\/]") |
462 skipRe = re.compile(r"DebugClients[\\/]Python[\\/]") |
463 sys.stdout = io.StringIO() |
463 sys.stdout = io.StringIO() |
464 if distDir: |
464 if distDir: |
465 compileall.compile_dir( |
465 compileall.compile_dir( |
466 os.path.join(eric7SourceDir, "DebugClients"), |
466 os.path.join(eric7SourceDir, "DebugClients"), |