From dc09ccbb864763cd3f96b9ea9261fc0c3c31f984 Mon Sep 17 00:00:00 2001 From: Bdale Garbee Date: Wed, 14 Oct 2015 14:15:02 -0600 Subject: [PATCH] script for extracting parts from a design to put in preferred parts db --- bin/extract-board-parts | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 bin/extract-board-parts diff --git a/bin/extract-board-parts b/bin/extract-board-parts new file mode 100755 index 0000000..f490972 --- /dev/null +++ b/bin/extract-board-parts @@ -0,0 +1,22 @@ +#!/bin/sh +# extract parts from a gEDA schematic for addition to preferred parts database +# Copyright 2015 Bdale Garbee , GPLv3+ +# assumes attribs file contents like: +# device +# value +# footprint +# loadstatus +# provided +# mfg_part_number +# vendor +# vendor_part_number + +gnetlist -g bom -o - $1.sch \ + | head -1 \ + | awk '{ printf("%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n", $2, $3, $4, $5, $6, $7, $8, $9) }' + +gnetlist -g bom -o - $1.sch \ + | tail -n +2 \ + | awk '{ printf("%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n", $2, $3, $4, $5, "no", $7, $8, $9) }' \ + | sort | uniq + -- 2.47.2