From: Keith Packard Date: Thu, 2 Nov 2023 04:33:24 +0000 (-0700) Subject: partslist-vendor: Support "seeed_part_number" field X-Git-Tag: telelco-v3.0~21^2~5 X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=4a3b2a7438f12a12cc7227356b33e38c53f7e48a;p=hw%2Faltusmetrum partslist-vendor: Support "seeed_part_number" field This allows us to leave the existing 4ucon parts in place while substituting more common part numbers when generating seeed quotes. Signed-off-by: Keith Packard --- diff --git a/bin/partslist-vendor b/bin/partslist-vendor index 423796e..6ac4217 100755 --- a/bin/partslist-vendor +++ b/bin/partslist-vendor @@ -114,8 +114,15 @@ string quoted(string v) void process_seeed(string[string] entry) { - if (entry["loadstatus"] == "noload") - return; + string part_number = entry["mfg_part_number"]; + if (hash_test(entry, "seeed_part_number") && entry["seeed_part_number"] != "unknown") { + part_number = entry["seeed_part_number"]; + } else { + if (entry["loadstatus"] == "noload") { + File::fprintf(stderr, "skipping part %v\n", entry); + return; + } + } static bool start = true; if (start) { @@ -133,7 +140,7 @@ void process_seeed(string[string] entry) } if (dim(refdes) > 1) printf ("\""); - printf(",%s,%s\n", quoted(entry["mfg_part_number"]), entry["quantity"]); + printf(",%s,%s\n", quoted(part_number), entry["quantity"]); } void process_goldphoenix(string[string] entry)