From 8f5d725524acf1cd1631e36de4de52efbee04ffa Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Thu, 4 Nov 2010 14:42:18 -0400 Subject: tools: Switch to checking UNINSTALLED_INTROSPECTION_SRCDIR Rather than introspecting the current directory, use the environment variable we know is present if and only if we're running uninstalled. This will be less prone to failure when we switch to nonrecursive make, since the generated script will be in the top builddir, not tools/ anymore. --- tools/g-ir-annotation-tool.in | 8 +++----- tools/g-ir-scanner.in | 8 +++----- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/tools/g-ir-annotation-tool.in b/tools/g-ir-annotation-tool.in index 4fbc4499..4ad19761 100755 --- a/tools/g-ir-annotation-tool.in +++ b/tools/g-ir-annotation-tool.in @@ -29,11 +29,9 @@ if 'GI_SCANNER_DEBUG' in os.environ: pdb.pm() sys.excepthook = on_exception -# This only works on unix systems -currentdir = os.path.dirname(os.path.abspath(sys.argv[0])) -current_name = os.path.basename(currentdir) -if current_name == 'tools': - path = os.path.abspath(os.path.join(currentdir, '..')) +srcdir=os.getenv('UNINSTALLED_INTROSPECTION_SRCDIR', None) +if srcdir is not None: + path = srcdir else: # This is a private directory, we don't want to pollute the global # namespace. diff --git a/tools/g-ir-scanner.in b/tools/g-ir-scanner.in index 943d9baa..86866c93 100755 --- a/tools/g-ir-scanner.in +++ b/tools/g-ir-scanner.in @@ -29,11 +29,9 @@ if 'GI_SCANNER_DEBUG' in os.environ: pdb.pm() sys.excepthook = on_exception -# This only works on unix systems -currentdir = os.path.dirname(os.path.abspath(sys.argv[0])) -current_name = os.path.basename(currentdir) -if current_name == 'tools': - path = os.path.abspath(os.path.join(currentdir, '..')) +srcdir=os.getenv('UNINSTALLED_INTROSPECTION_SRCDIR', None) +if srcdir is not None: + path = srcdir else: # This is a private directory, we don't want to pollute the global # namespace. -- cgit v1.2.1