[jhbuild] [config] set required variables to make it work with the old start script
- From: Frederic Peters <fpeters src gnome org>
- To: svn-commits-list gnome org
- Subject: [jhbuild] [config] set required variables to make it work with the old start script
- Date: Tue, 2 Jun 2009 10:16:17 -0400 (EDT)
commit 6b9a3f40c1dec10e2ccda5b5ec026e6e1159eb1b
Author: Frédéric Péters <fpeters 0d be>
Date: Tue Jun 2 16:13:27 2009 +0200
[config] set required variables to make it work with the old start script
Following up on bug 582490 it now checks for ~/bin/ vs ~/.local/bin/ and
display an informative message, plus it sets the new variables from what
the old script put in sys.path so jhbuild can start correctly.
---
jhbuild/config.py | 22 +++++++++++++++++++++-
1 files changed, 21 insertions(+), 1 deletions(-)
diff --git a/jhbuild/config.py b/jhbuild/config.py
index 5a65b18..c286244 100644
--- a/jhbuild/config.py
+++ b/jhbuild/config.py
@@ -23,6 +23,7 @@ import sys
import traceback
import types
import logging
+import __builtin__
from jhbuild.errors import UsageError, FatalError, CommandError
from jhbuild.utils.cmds import get_output
@@ -125,7 +126,26 @@ class Config:
try:
SRCDIR
except NameError:
- raise FatalError(_('Obsolete jhbuild start script, do run \'make install\''))
+ # this happens when an old jhbuild script is called
+ if os.path.realpath(sys.argv[0]) == os.path.expanduser('~/bin/jhbuild'):
+ # if it was installed in ~/bin/, it may be because the new one
+ # is installed in ~/.local/bin/jhbuild
+ if os.path.exists(os.path.expanduser('~/.local/bin/jhbuild')):
+ logging.warning(
+ _('JHBuild start script has been installed in '
+ '~/.local/bin/jhbuild, you should remove the '
+ 'old version that is still in ~/bin/ (or make '
+ 'it a symlink to ~/.local/bin/jhbuild'))
+ if os.path.exists(os.path.join(sys.path[0], 'jhbuild')):
+ # the old start script inserted its source directory in
+ # sys.path, use it now to set new variables
+ __builtin__.__dict__['SRCDIR'] = sys.path[0]
+ __builtin__.__dict__['PKGDATADIR'] = None
+ __builtin__.__dict__['DATADIR'] = None
+ else:
+ raise FatalError(
+ _('Obsolete jhbuild start script, make sure it is removed '
+ 'then do run \'make install\''))
env_prepends.clear()
try:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]