[tracker/wip/sam/meson] sandbox: Fix MIME hack introduced in 8a758a03afada



commit a6ef13d4d9cbcedc625ca86088cf3d46e9bd9b0b
Author: Sam Thursfield <sam afuera me uk>
Date:   Thu Jun 30 00:03:12 2016 +0100

    sandbox: Fix MIME hack introduced in 8a758a03afada
    
    It seems that new systems don't have this custom 'mime' dir (which
    is good news), it's just some weird relic that exists on my laptop.
    The workaround should now not break things in any case.

 utils/sandbox/tracker-sandbox.py |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/utils/sandbox/tracker-sandbox.py b/utils/sandbox/tracker-sandbox.py
index abfb05b..2221cf5 100755
--- a/utils/sandbox/tracker-sandbox.py
+++ b/utils/sandbox/tracker-sandbox.py
@@ -410,11 +410,13 @@ def link_to_mime_data():
 
        '''
        new_xdg_data_home = os.environ['XDG_DATA_HOME']
-       new_mime_dir = os.path.join(new_xdg_data_home, 'mime')
-       if not os.path.exists(new_mime_dir):
-               mkdir_p(new_xdg_data_home)
-               os.symlink(
-                       os.path.join(original_xdg_data_home, 'mime'), new_mime_dir)
+       old_mime_dir = os.path.join(original_xdg_data_home, 'mime')
+       if os.path.exists(old_mime_dir):
+               new_mime_dir = os.path.join(new_xdg_data_home, 'mime')
+               if not os.path.exists(new_mime_dir) and not os.path.islink(new_mime_dir):
+                       mkdir_p(new_xdg_data_home)
+                       os.symlink(
+                               os.path.join(original_xdg_data_home, 'mime'), new_mime_dir)
 
 
 # Entry point/start


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]