Improved install script for non-root installations. 5_4_x

Sat, 09 Aug 2014 12:23:18 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 09 Aug 2014 12:23:18 +0200
branch
5_4_x
changeset 3754
57e71efb769f
parent 3749
2f6d6904fbc0
child 3755
ebdce5a693ac

Improved install script for non-root installations.
(grafted from 3b5476d5420c2d397c3247de4091471dda9351ef)
(grafted from b269d3e5f310bd86cac08c7523300f315f356fbd)

install.py file | annotate | diff | comparison | revisions
uninstall.py file | annotate | diff | comparison | revisions
--- a/install.py	Wed Aug 06 18:54:06 2014 +0200
+++ b/install.py	Sat Aug 09 12:23:18 2014 +0200
@@ -341,7 +341,7 @@
     global pyModDir, progLanguages
     
     # Remove the menu entry for Linux systems
-    if sys.platform.startswith("linux"):
+    if sys.platform.startswith("linux") and os.getuid() == 0:
         for name in ["/usr/share/pixmaps/eric.png",
                      "/usr/share/applications/eric5.desktop",
                      "/usr/share/appdata/eric5.appdata.xml",
@@ -655,7 +655,7 @@
             if not os.path.exists(dst):
                 os.makedirs(dst)
             shutilCopy(os.path.join(sourceDir, "eric5.appdata.xml"), dst)
-        else:
+        elif os.getuid() == 0:
             shutilCopy(os.path.join(
                 sourceDir, "icons", "default", "eric.png"),
                 "/usr/share/pixmaps/eric.png")
--- a/uninstall.py	Wed Aug 06 18:54:06 2014 +0200
+++ b/uninstall.py	Sat Aug 09 12:23:18 2014 +0200
@@ -89,9 +89,10 @@
     global pyModDir
     
     # Remove the menu entry for Linux systems
-    if sys.platform.startswith("linux"):
+    if sys.platform.startswith("linux") and os.getuid() == 0:
         for name in ["/usr/share/pixmaps/eric.png",
                      "/usr/share/applications/eric5.desktop",
+                     "/usr/share/appdata/eric6.appdata.xml",
                      "/usr/share/pixmaps/ericWeb.png",
                      "/usr/share/applications/eric5_webbrowser.desktop"]:
             if os.path.exists(name):

eric ide

mercurial