diff options
Diffstat (limited to 'scripts/config.py')
-rw-r--r-- | scripts/config.py | 64 |
1 files changed, 14 insertions, 50 deletions
diff --git a/scripts/config.py b/scripts/config.py index 0d7a1b8..c9a1049 100644 --- a/scripts/config.py +++ b/scripts/config.py @@ -6,69 +6,33 @@ import jhbuild.config import sysdeps class Config(jhbuild.config.Config): - def __init__(self, rc_file): - scripts_dir = os.path.dirname(__file__) - self._base_dir = os.path.dirname(scripts_dir) - self._set_dir = os.path.join(self._base_dir, 'config', 'modulesets') - - jhbuild.config.Config.__init__(self, self._ensure_rc_file(rc_file)) - + def __init__(self, base_dir, rc_file): + self.base_dir = base_dir + jhbuild.config.Config.__init__(self, os.path.join(self.base_dir, 'sugar.jhbuildrc')) self._setup() - def get_user_path(self): - user_path = os.path.expanduser('~/.sugar-jhbuild') - if not os.path.exists(user_path): - os.mkdir(user_path) - return user_path - - def _ensure_rc_file(self, rc_file): - if not os.path.exists(rc_file): - f = open(rc_file, 'w') - f.write('# Created by sugar-jhbuild') - f.close - return rc_file - def _setup(self): self.autogenargs = '' - self.moduleset = [] - self._add_moduleset('glucose-external.modules') - self._add_moduleset('tools.modules') - self._add_moduleset('extra.modules') - self._add_moduleset('extra-activities.modules') - - release_dir = None - for f in os.listdir(self._set_dir): - if f.startswith('release-'): - release_dir = f - - self._add_moduleset('glucose.modules', release_dir) - self._add_moduleset('fructose.modules', release_dir) - - self.modules = [ 'meta-tools', - 'meta-glucose', - 'meta-fructose' ] - - self.checkoutroot = os.path.join(self._base_dir, 'source') - self.tarballdir = self.checkoutroot - + self.checkoutroot = os.path.join(self.base_dir, 'source') + self.tarballdir = os.path.join(self.base_dir, 'source') + self.moduleset = os.path.join(self.base_dir, 'config', + 'modulesets', 'sugar.modules') + for package, source in sysdeps.get_packages(): if source and source not in self.skip: self.skip.append(source) - def _add_moduleset(self, moduleset, release_dir=None): - if release_dir: - path = os.path.join(self._set_dir, release_dir) - else: - path = self._set_dir - - self.moduleset.append(os.path.join(path, moduleset)) - def setup_env(self): # Hack to replace the default prefix if self.prefix == '/opt/gnome2': - self.prefix = os.path.join(self._base_dir, 'install') + self.prefix = os.path.join(self.base_dir, 'install') + + #Hack to allow sugar-jhbuild to find its self again. + MY_PATH = os.getenv('PATH', 'Error') + os.environ["PATH"] = MY_PATH + ':' + self.base_dir + jhbuild.config.Config.setup_env(self) jhbuild.config.addpath('XDG_DATA_DIRS', '/usr/share') |