From cc8e682ab03fc38d56202823e0120bb62cdfcc3e Mon Sep 17 00:00:00 2001 From: Daniel Drake Date: Tue, 15 Jul 2008 12:12:16 -0400 Subject: [PATCH] #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 --- src/sugar/bundle/contentbundle.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/sugar/bundle/contentbundle.py b/src/sugar/bundle/contentbundle.py index 3de64142..38d4e513 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: