summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugeniy Mikhailov <evgmik@gmail.com>2014-07-18 16:54:56 -0400
committerEugeniy Mikhailov <evgmik@gmail.com>2014-07-18 16:54:56 -0400
commit16a892d5b0c4a928a2a2f9db04d191ed48caa268 (patch)
tree481ed5c57dedd97907c41f6fbdbba5babe7296ce
parent5568fb9b3bb38d24fd89c40ed0f01b3b4fe5b1c4 (diff)
downloadeagle-16a892d5b0c4a928a2a2f9db04d191ed48caa268.tar.gz
eagle-16a892d5b0c4a928a2a2f9db04d191ed48caa268.zip
helper file to fix discrepancy between board and schematics
-rwxr-xr-xscripts/value_fix.sh25
1 files changed, 25 insertions, 0 deletions
diff --git a/scripts/value_fix.sh b/scripts/value_fix.sh
new file mode 100755
index 0000000..3858401
--- /dev/null
+++ b/scripts/value_fix.sh
@@ -0,0 +1,25 @@
+#!/bin/sh
+# FILE: "/home/evmik/eagle/scripts/value_fix.sh"
+# LAST MODIFICATION: "Fri, 18 Jul 2014 16:54:10 -0400 (evmik)"
+# (C) 2014 by Eugeniy Mikhailov, <evgmik@gmail.com>
+# $Id:$
+
+
+# Tries to fix eagle schematic to board discrepancy if some one ascendantly changes values in schematic while
+# the board file was not connected
+
+# To avoid gotchas copy the board file into t.brd, it will be edited in place.
+# Once you happy with fixes overwrite the original eagle board file with t.brd
+
+# Look thought the diff and file list of parts with updated values
+git diff | grep '+<part name="' |sed s/'+<part name="\([^"]*\)".*value="\([^"]*\).*'/'\1 \2'/ >part.list
+
+# Now update components values in the board file.
+# Assumes that board file is copied into t.brd file
+cat part.list | \
+while read part v
+do
+ echo zzz $part zzz $v
+ sed -i s\z'\(<element name="\)'"$part"'\(".*value="\)[^"]*\(".*\)$'\z'\1'"$part"'\2'"$v"'\3'\z t.brd
+done
+