From: Daniel Drake Date: Tue, 15 Jul 2008 16:12:16 +0000 (-0400) Subject: #7523 library regeneration fails as XDG_DATA_DIRS is unset X-Git-Tag: v0.81.7~4 X-Git-Url: http://dev.laptop.org/git?p=sugar-toolkit;a=commitdiff_plain;h=cc8e682ab03fc38d56202823e0120bb62cdfcc3e #7523 library regeneration fails as XDG_DATA_DIRS is unset The XDG specs say that a default value should be used if it is not set --- diff --git a/src/sugar/bundle/contentbundle.py b/src/sugar/bundle/contentbundle.py index 3de6414..38d4e51 100644 --- a/src/sugar/bundle/contentbundle.py +++ b/src/sugar/bundle/contentbundle.py @@ -168,11 +168,12 @@ class ContentBundle(Bundle): return self._bundle_class def _run_indexer(self): - if os.environ.has_key('XDG_DATA_DIRS'): - for path in os.environ['XDG_DATA_DIRS'].split(':'): - indexer = os.path.join(path, 'library-common', 'make_index.py') - if os.path.exists(indexer): - os.spawnlp(os.P_WAIT, 'python', 'python', indexer) + xdg_data_dirs = os.getenv('XDG_DATA_DIRS', + '/usr/local/share/:/usr/share/') + for path in xdg_data_dirs.split(':'): + indexer = os.path.join(path, 'library-common', 'make_index.py') + if os.path.exists(indexer): + os.spawnlp(os.P_WAIT, 'python', 'python', indexer) def is_installed(self): if self._unpacked: