From c522acab33da01817976e4df725a20ab4c3e50a2 Mon Sep 17 00:00:00 2001 From: Tim Edwards Date: Tue, 24 Apr 2018 09:29:05 -0400 Subject: [PATCH] Corrected a minor issue with the database read incorrectly generating an error message when reading uses from a .mag file. Also modified the GDS write routine to provide an error message when an abstract view points to a GDS file but the GDS file cannot be found. --- calma/CalmaWrite.c | 4 ++-- database/DBio.c | 53 ++++++++++++++++++++++++---------------------- 2 files changed, 30 insertions(+), 27 deletions(-) diff --git a/calma/CalmaWrite.c b/calma/CalmaWrite.c index 910dfdde..f3d0e66b 100644 --- a/calma/CalmaWrite.c +++ b/calma/CalmaWrite.c @@ -681,12 +681,12 @@ calmaProcessDef(def, outf) /* another vendor GDS, it would not normally be output. */ DBPropGet(def->cd_parents->cu_parent, "GDS_FILE", &isReadOnly); - if (!isReadOnly) + if (!isReadOnly || isAbstract) TxError("Calma output error: Can't find GDS file \"%s\" " "for vendor cell \"%s\". Using magic's " "internal definition\n", filename, def->cd_name); - else + if (isReadOnly) def->cd_flags |= CDVENDORGDS; } else if (isAbstract) diff --git a/database/DBio.c b/database/DBio.c index a3f3db4d..e04f6a9a 100644 --- a/database/DBio.c +++ b/database/DBio.c @@ -1400,39 +1400,42 @@ badTransform: /* now two versions of the same cell name coming from different */ /* sources, and this must be corrected. */ - if (subCellDef->cd_file != NULL) + if (*pathptr != '\0') { - slashptr = strrchr(subCellDef->cd_file, '/'); - if (slashptr != NULL) + if (subCellDef->cd_file != NULL) { - *slashptr = '\0'; - - if (strcmp(subCellDef->cd_file, pathptr)) + slashptr = strrchr(subCellDef->cd_file, '/'); + if (slashptr != NULL) { - TxError("Duplicate cell in %s: Instance of cell %s is from " - "path %s but cell was previously read from %s.\n", - cellDef->cd_name, slashptr + 1, pathptr, - subCellDef->cd_file); + *slashptr = '\0'; - /* To do: Check if new path does not exist (ignore), */ - /* or if new path has same symbolic link or is the same */ - /* filesize and checksum (ignore). If file appears to */ - /* be truly different, then create a new cell with a */ - /* modified cell name. */ + if (strcmp(subCellDef->cd_file, pathptr)) + { + TxError("Duplicate cell in %s: Instance of cell %s is from " + "path %s but cell was previously read from %s.\n", + cellDef->cd_name, slashptr + 1, pathptr, + subCellDef->cd_file); - TxError("New path will be ignored. Please check.\n"); + /* To do: Check if new path does not exist (ignore), */ + /* or if new path has same symbolic link or is the same */ + /* filesize and checksum (ignore). If file appears to */ + /* be truly different, then create a new cell with a */ + /* modified cell name. */ + + TxError("New path will be ignored. Please check.\n"); + } + *slashptr = '/'; } - *slashptr = '/'; } - } - else if (*pathptr != '\0') - { - /* Reconstruct file from path and cellname */ + else + { + /* Reconstruct file from path and cellname */ - strcat(path, "/"); - strcat(path, subCellDef->cd_name); - strcat(path, DBSuffix); - StrDup(&subCellDef->cd_file, path); + strcat(path, "/"); + strcat(path, subCellDef->cd_name); + strcat(path, DBSuffix); + StrDup(&subCellDef->cd_file, path); + } } subCellUse = DBCellNewUse(subCellDef, (useid[0]) ?