Add --update flag to importer scripts; update XTAC5212IRGER to newer UL export
The importers previously refused to touch an already-imported component by design, which meant re-importing an updated UltraLibrarian/SnapEDA zip for the same part-number errored out. Add --update to import_component.py's import_symbol/import_footprint (and thread it through import_snapeda.py and import_ultralibrarian.py) so an existing symbol/footprint can be replaced in place instead, with the manifest recording it as UPDATED rather than NEW. Used it to refresh XTAC5212IRGER from a newer UltraLibrarian download (single-unit symbol layout vs. the previous split power/signal units; same 29 pins). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -66,6 +66,7 @@ def main() -> int:
|
||||
parser.add_argument("--zip", required=True, help="Path to the SnapEDA .zip download")
|
||||
parser.add_argument("--name", help="Component name (default: taken from the symbol's own name)")
|
||||
parser.add_argument("--category", choices=lc.CATEGORIES, help="MIKILAB category (default: auto-detected)")
|
||||
parser.add_argument("--update", action="store_true", help="Replace an existing component's symbol/footprint in place instead of refusing")
|
||||
args = parser.parse_args()
|
||||
|
||||
zip_path = Path(args.zip).expanduser().resolve()
|
||||
@@ -103,14 +104,14 @@ def main() -> int:
|
||||
report.append(f" found {label}: {path.relative_to(tmp_dir) if path else '(none)'}")
|
||||
|
||||
try:
|
||||
ic.import_symbol(name, category, symbol, manifest_rows, report)
|
||||
ic.import_symbol(name, category, symbol, manifest_rows, report, update=args.update)
|
||||
except ic.ImportError_ as e:
|
||||
print(f"ERROR: {e}")
|
||||
lc.append_manifest_rows(ROOT, [["symbol", str(zip_path), "", "ERROR", "", str(e)]])
|
||||
return 1
|
||||
|
||||
if footprint is not None:
|
||||
fp_path, fp_nick, fp_name, _ = ic.import_footprint(name, category, footprint, manifest_rows, report)
|
||||
fp_path, fp_nick, fp_name, _ = ic.import_footprint(name, category, footprint, manifest_rows, report, update=args.update)
|
||||
|
||||
if model is not None:
|
||||
ic.import_model(name, category, model, fp_path, manifest_rows, report)
|
||||
|
||||
Reference in New Issue
Block a user