[gem5-dev] Change in gem5/gem5[develop]: scons: Replace find_first_prog() with the built in Detect().

2020-03-27 Thread Gabe Black (Gerrit)
Gabe Black has submitted this change. (  
https://gem5-review.googlesource.com/c/public/gem5/+/27126 )


Change subject: scons: Replace find_first_prog() with the built in Detect().
..

scons: Replace find_first_prog() with the built in Detect().

The built in environment method Detect() does the same thing, that is it
finds the first program available from a list of options.

Change-Id: I3763ae5cc9dd22ee322908c0a7a2c037dc91d5a5
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/27126
Reviewed-by: Nikos Nikoleris 
Maintainer: Bobby R. Bruce 
Tested-by: kokoro 
---
M SConstruct
1 file changed, 1 insertion(+), 14 deletions(-)

Approvals:
  Nikos Nikoleris: Looks good to me, approved
  Bobby R. Bruce: Looks good to me, approved
  kokoro: Regressions pass



diff --git a/SConstruct b/SConstruct
index 4273d14..f5eb0ca 100755
--- a/SConstruct
+++ b/SConstruct
@@ -214,19 +214,6 @@
 return [abspath(joinpath(root, expanduser(str(p
 for p in path_list]

-def find_first_prog(prog_names):
-"""Find the absolute path to the first existing binary in prog_names"""
-
-if not isinstance(prog_names, (list, tuple)):
-prog_names = [ prog_names ]
-
-for p in prog_names:
-p = main.WhereIs(p)
-if p is not None:
-return p
-
-return None
-
 # Each target must have 'build' in the interior of the path; the
 # directory below this will determine the build parameters.  For
 # example, for target 'foo/bar/build/X86/arch/x86/blah.do' we
@@ -679,7 +666,7 @@
 # version of python, see above for instructions on how to invoke
 # scons with the appropriate PATH set.

-python_config = find_first_prog(main['PYTHON_CONFIG'])
+python_config = main.Detect(main['PYTHON_CONFIG'])
 if python_config is None:
 error("Can't find a suitable python-config, tried %s" % \
   main['PYTHON_CONFIG'])

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/27126
To unsubscribe, or for help writing mail filters, visit  
https://gem5-review.googlesource.com/settings


Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I3763ae5cc9dd22ee322908c0a7a2c037dc91d5a5
Gerrit-Change-Number: 27126
Gerrit-PatchSet: 2
Gerrit-Owner: Gabe Black 
Gerrit-Reviewer: Bobby R. Bruce 
Gerrit-Reviewer: Gabe Black 
Gerrit-Reviewer: Gabe Black 
Gerrit-Reviewer: Jason Lowe-Power 
Gerrit-Reviewer: Nikos Nikoleris 
Gerrit-Reviewer: kokoro 
Gerrit-CC: Earl Ou 
Gerrit-CC: Jui-min Lee 
Gerrit-CC: Yu-hsin Wang 
Gerrit-MessageType: merged
___
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev

[gem5-dev] Change in gem5/gem5[develop]: scons: Replace find_first_prog() with the built in Detect().

2020-03-26 Thread Gabe Black (Gerrit)

Hello Gabe Black,

I'd like you to do a code review. Please visit

https://gem5-review.googlesource.com/c/public/gem5/+/27126

to review the following change.


Change subject: scons: Replace find_first_prog() with the built in Detect().
..

scons: Replace find_first_prog() with the built in Detect().

The built in environment method Detect() does the same thing, that is it
finds the first program available from a list of options.

Change-Id: I3763ae5cc9dd22ee322908c0a7a2c037dc91d5a5
---
M SConstruct
1 file changed, 1 insertion(+), 14 deletions(-)



diff --git a/SConstruct b/SConstruct
index 4273d14..f5eb0ca 100755
--- a/SConstruct
+++ b/SConstruct
@@ -214,19 +214,6 @@
 return [abspath(joinpath(root, expanduser(str(p
 for p in path_list]

-def find_first_prog(prog_names):
-"""Find the absolute path to the first existing binary in prog_names"""
-
-if not isinstance(prog_names, (list, tuple)):
-prog_names = [ prog_names ]
-
-for p in prog_names:
-p = main.WhereIs(p)
-if p is not None:
-return p
-
-return None
-
 # Each target must have 'build' in the interior of the path; the
 # directory below this will determine the build parameters.  For
 # example, for target 'foo/bar/build/X86/arch/x86/blah.do' we
@@ -679,7 +666,7 @@
 # version of python, see above for instructions on how to invoke
 # scons with the appropriate PATH set.

-python_config = find_first_prog(main['PYTHON_CONFIG'])
+python_config = main.Detect(main['PYTHON_CONFIG'])
 if python_config is None:
 error("Can't find a suitable python-config, tried %s" % \
   main['PYTHON_CONFIG'])

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/27126
To unsubscribe, or for help writing mail filters, visit  
https://gem5-review.googlesource.com/settings


Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I3763ae5cc9dd22ee322908c0a7a2c037dc91d5a5
Gerrit-Change-Number: 27126
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black 
Gerrit-Reviewer: Gabe Black 
Gerrit-MessageType: newchange
___
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev