Add a function for iterating through all exe locations in the PATH.

Review Request #12617 — Created Sept. 21, 2022 and submitted

Information

RBTools
release-4.x

Reviewers

This introduces rbtools.utils.filesystem.iter_exes_in_path(), which
looks for the specified executable in each path in $PATH, yielding
each one that's found. This can be used to scan for multiple instances
of an executable, trying to find a specific version.

is_exe_in_path() now wraps this, returning just the first result.

Unit tests pass.

Tested this extensively with the Diff Tool scanning.

Summary ID
Add a function for iterating through all exe locations in the PATH.
This introduces `rbtools.utils.filesystem.iter_exes_in_path()`, which looks for the specified executable in each path in `$PATH`, yielding each one that's found. This can be used to scan for multiple instances of an executable, trying to find a specific version. `is_exe_in_path()` now wraps this, returning just the first result.
781a3e658616e19f5f9d7ff0085391bae330f1db
Description From Last Updated

Mind killing this while you're in here?

daviddavid

executable -> executables

daviddavid

Wrapping here seems a little off.

daviddavid
david
  1. 
      
  2. rbtools/utils/filesystem.py (Diff revision 1)
     
     

    Mind killing this while you're in here?

  3. rbtools/utils/filesystem.py (Diff revision 1)
     
     

    executable -> executables

  4. rbtools/utils/filesystem.py (Diff revision 1)
     
     
     
     

    Wrapping here seems a little off.

  5. 
      
chipx86
maubin
  1. Ship It!
  2. 
      
david
  1. Ship It!
  2. 
      
chipx86
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-4.x (19c202c)
Loading...