172 try: |
172 try: |
173 # Cleanup the install directories |
173 # Cleanup the install directories |
174 dirname = os.path.join(pyModDir, installPackage) |
174 dirname = os.path.join(pyModDir, installPackage) |
175 if os.path.exists(dirname): |
175 if os.path.exists(dirname): |
176 shutil.rmtree(dirname, True) |
176 shutil.rmtree(dirname, True) |
177 except (IOError, OSError) as msg: |
177 except OSError as msg: |
178 sys.stderr.write( |
178 sys.stderr.write( |
179 'Error: {0}\nTry install with admin rights.\n'.format(msg)) |
179 'Error: {0}\nTry install with admin rights.\n'.format(msg)) |
180 exit(7) |
180 exit(7) |
181 |
181 |
182 |
182 |
218 excludePatterns=["eric6config.py*"]) |
218 excludePatterns=["eric6config.py*"]) |
219 |
219 |
220 # copy the license file |
220 # copy the license file |
221 shutilCopy(os.path.join(sourceDir, "docs", "LICENSE.GPL3"), targetDir) |
221 shutilCopy(os.path.join(sourceDir, "docs", "LICENSE.GPL3"), targetDir) |
222 |
222 |
223 except (IOError, OSError) as msg: |
223 except OSError as msg: |
224 sys.stderr.write( |
224 sys.stderr.write( |
225 'Error: {0}\nTry install with admin rights.\n'.format(msg)) |
225 'Error: {0}\nTry install with admin rights.\n'.format(msg)) |
226 return(7) |
226 return(7) |
227 |
227 |
228 return 0 |
228 return 0 |
295 print("Cleaning up old installation ...") |
295 print("Cleaning up old installation ...") |
296 if distDir: |
296 if distDir: |
297 shutil.rmtree(distDir, True) |
297 shutil.rmtree(distDir, True) |
298 else: |
298 else: |
299 cleanUp() |
299 cleanUp() |
300 except (IOError, OSError) as msg: |
300 except OSError as msg: |
301 sys.stderr.write('Error: {0}\nTry install as root.\n'.format(msg)) |
301 sys.stderr.write('Error: {0}\nTry install as root.\n'.format(msg)) |
302 exit(7) |
302 exit(7) |
303 |
303 |
304 if doCompile: |
304 if doCompile: |
305 print("\nCompiling source files ...") |
305 print("\nCompiling source files ...") |