Commit 89cbb85b by Diego Novillo Committed by Diego Novillo

Loosen check for build directory.

	* validate_failures.py: Loosen check for build directory.
	State what failed if we couldn't find the source tree or
	the target triplet.

From-SVN: r198064
parent 23662b9a
2013-04-18 Diego Novillo <dnovillo@google.com>
* validate_failures.py: Loosen check for build directory.
State what failed if we couldn't find the source tree or
the target triplet.
2013-03-22 Jakub Jelinek <jakub@redhat.com> 2013-03-22 Jakub Jelinek <jakub@redhat.com>
* gennews (files): Add files for GCC 4.8. * gennews (files): Add files for GCC 4.8.
......
...@@ -196,11 +196,9 @@ def GetMakefileValue(makefile_name, value_name): ...@@ -196,11 +196,9 @@ def GetMakefileValue(makefile_name, value_name):
return None return None
def ValidBuildDirectory(builddir, target): def ValidBuildDirectory(builddir):
if (not os.path.exists(builddir) or if (not os.path.exists(builddir) or
not os.path.exists('%s/Makefile' % builddir) or not os.path.exists('%s/Makefile' % builddir)):
(not os.path.exists('%s/build-%s' % (builddir, target)) and
not os.path.exists('%s/%s' % (builddir, target)))):
return False return False
return True return True
...@@ -362,14 +360,17 @@ def GetManifestPath(srcdir, target, user_provided_must_exist): ...@@ -362,14 +360,17 @@ def GetManifestPath(srcdir, target, user_provided_must_exist):
Error('Manifest does not exist: %s' % manifest_path) Error('Manifest does not exist: %s' % manifest_path)
return manifest_path return manifest_path
else: else:
assert srcdir and target if not srcdir:
Error('Could not determine where the location of GCC\'s source tree. '
'The Makefile does not contain a definition for "srcdir".')
if not target:
Error('Could not determine the target triplet for this build. '
'The Makefile does not contain a definition for "target_alias".')
return _MANIFEST_PATH_PATTERN % (srcdir, _MANIFEST_SUBDIR, target) return _MANIFEST_PATH_PATTERN % (srcdir, _MANIFEST_SUBDIR, target)
def GetBuildData(): def GetBuildData():
srcdir = GetMakefileValue('%s/Makefile' % _OPTIONS.build_dir, 'srcdir =') if not ValidBuildDirectory(_OPTIONS.build_dir):
target = GetMakefileValue('%s/Makefile' % _OPTIONS.build_dir, 'target_alias=')
if not ValidBuildDirectory(_OPTIONS.build_dir, target):
# If we have been given a set of results to use, we may # If we have been given a set of results to use, we may
# not be inside a valid GCC build directory. In that case, # not be inside a valid GCC build directory. In that case,
# the user must provide both a manifest file and a set # the user must provide both a manifest file and a set
...@@ -380,6 +381,8 @@ def GetBuildData(): ...@@ -380,6 +381,8 @@ def GetBuildData():
_OPTIONS.build_dir) _OPTIONS.build_dir)
else: else:
return None, None return None, None
srcdir = GetMakefileValue('%s/Makefile' % _OPTIONS.build_dir, 'srcdir =')
target = GetMakefileValue('%s/Makefile' % _OPTIONS.build_dir, 'target_alias=')
print 'Source directory: %s' % srcdir print 'Source directory: %s' % srcdir
print 'Build target: %s' % target print 'Build target: %s' % target
return srcdir, target return srcdir, target
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment