diff --git a/edk2toollib/database/tables/instanced_inf_table.py b/edk2toollib/database/tables/instanced_inf_table.py index f7f0b6f6..87c3dd89 100644 --- a/edk2toollib/database/tables/instanced_inf_table.py +++ b/edk2toollib/database/tables/instanced_inf_table.py @@ -43,7 +43,7 @@ class TEXT, GET_ROW_ID = ''' SELECT id FROM instanced_inf -WHERE env = ? and path = ? and dsc = ? and (class = ? OR class IS NULL) +WHERE env = ? and path = ? and component = ? LIMIT 1 ''' @@ -114,7 +114,7 @@ def parse(self, db_cursor: Cursor, pathobj: Edk2Path, id: str, env: dict) -> Non db_cursor.execute(INSERT_INSTANCED_INF_ROW, row) for e in inf_entries: - inf_id = db_cursor.execute(GET_ROW_ID, (id, e["PATH"], e["DSC"], e["LIBRARY_CLASS"])).fetchone()[0] + inf_id = db_cursor.execute(GET_ROW_ID, (id, e["PATH"], e["COMPONENT"])).fetchone()[0] # Add junction entries to link source the source files used by an INF for source in e["SOURCES_USED"]: @@ -126,11 +126,7 @@ def parse(self, db_cursor: Cursor, pathobj: Edk2Path, id: str, env: dict) -> Non if instance is None: used_inf_id = None # no library instance found for this library class else: - try: - used_inf_id = db_cursor.execute(GET_ROW_ID, (id, instance, e["DSC"], cls)).fetchone()[0] - except Exception: - logging.warning(f"Failed to get row id for {id},{instance},{e['DSC']}{cls}") - used_inf_id = None + used_inf_id = db_cursor.execute(GET_ROW_ID, (id, instance, e["COMPONENT"])).fetchone()[0] row = (id, "instanced_inf", inf_id, "instanced_inf", used_inf_id) db_cursor.execute(INSERT_JUNCTION_ROW, row)