Review Board 2.0.15


Old Path Diff for gabe

Review Request #499 - Created Feb. 23, 2011 and updated

Information
Nathan Binkert
gem5
Reviewers
Default
ali, gblack, nate, stever
This is some really old code that I wrote to work on the path problem (I didn't realize that I had never committed it.)  Anyway, you may find this interesting and as a possible way to augment your diff Gabe.  (Feel free to incorporate it).  I'll put a few comments in reviewboard here (which should probably just be in the code itself).

One major thing that should happen if you choose to use this is that path.py and maybe even SysPaths.py too should be in m5.util.

   
Posted (Feb. 23, 2011, 3:13 a.m.)
Just some comments on the code.
configs/common/SysPaths.py (Diff revision 2)
 
 
you could do "from SysPaths import disks, binaries, boot"

then you can do

filepath = disk.find("imagename.img")
configs/common/path.py (Diff revision 2)
 
 
Both types of paths are searched
configs/common/path.py (Diff revision 2)
 
 
I did this for backwards compat, but __call__ should probably go and we should probably only have find, doesn't matter much though.
configs/common/path.py (Diff revision 2)
 
 
This class encapsulates the normal concept of a "path"
configs/common/path.py (Diff revision 2)
 
 
The idea of a subpath is that there is a fixed directory structure within the path and you want to find a file within that known subdirectory.  The "system" directory is the Path and we use SubPath for binaries, disks, and boot scripts which are fixed subdirectories that will be searched for in the path.