diff --git a/edk2toollib/database/tables/package_table.py b/edk2toollib/database/tables/package_table.py index 9e24f1cb..4db3bfe6 100644 --- a/edk2toollib/database/tables/package_table.py +++ b/edk2toollib/database/tables/package_table.py @@ -50,6 +50,10 @@ def parse(self, db_cursor: Cursor, pathobj: Edk2Path, id: str, env: dict) -> Non for file in Path(pathobj.WorkspacePath).rglob("*.dec"): pkg = pathobj.GetContainingPackage(str(file)) containing_repo = "BASE" + if "origin" in repo.remotes: + containing_repo = repo.remotes.origin.url.split("/")[-1].split(".git")[0].upper() + elif len(repo.remotes) > 0: + containing_repo = repo.remotes[0].url.split("/")[-1].split(".git")[0].upper() if repo: for submodule in repo.submodules: if submodule.abspath in str(file): diff --git a/tests.unit/database/test_package_table.py b/tests.unit/database/test_package_table.py index a22a37cb..40e2c473 100644 --- a/tests.unit/database/test_package_table.py +++ b/tests.unit/database/test_package_table.py @@ -35,9 +35,9 @@ def test_basic_parse(tmp_path): results = db.connection.cursor().execute("SELECT * FROM package").fetchall() to_pass = { - ("QemuPkg", "BASE"): False, - ("QemuSbsaPkg", "BASE"): False, - ("QemuQ35Pkg", "BASE"): False, + ("QemuPkg", "MU_TIANO_PLATFORMS"): False, + ("QemuSbsaPkg", "MU_TIANO_PLATFORMS"): False, + ("QemuQ35Pkg", "MU_TIANO_PLATFORMS"): False, ("SetupDataPkg", "Features/CONFIG"): False, } for result in results: