Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
path_utilities: Adjust GetContainingPackage() and Edk2Path behavior (#…
…186) Updates the Edk2Path constructor with the following changes: - Avoid changing global object state during intermediary validation operations. If an exception were returned or execution is otherwise interrupted the `PackagePathList` and `WorkspacePath` will have predictable values only set once validation succeeds. - Raise a `NotADirectoryError` exception on invalid directory input. This allows the caller to implement more focused exception handling. - Update the definition of a package to be a directory with a .dec file and use that as the basis for detecting nested packages. - Update the nested package path algorithm to fix #183 and prevent exceeding ascension in the directory hierarchy beyond the maximum root directory being compared. - Minor documentation cleanup. Update GetContainingPackage() with the following changes: - Only return a containing package if a file is in a directory with a .dec file. Avoid returning directory parents outside edk2 packages. Closes #185. - Minor documentation cleanup. Updates both functions to remove superfluous logging and leave it to the caller to manage logging messages based on the context of the actions they are trying to perform. Updates unit tests to align with updated function expectations. Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
- Loading branch information
Showing
2 changed files
with
177 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.