6 echo \\tpcbdiff firstfile secondfile
7 echo \\tView a graphical
diff of PCB files
9 echo \\tTo use with git
, just place this
script in your PATH and
do
10 echo \\tgit difftool
-x pcbdiff ...
12 echo \\tTo use with mercurial
, add the following lines to your .hgrc
:
13 echo \\t
\\t
[extensions
]
14 echo \\t
\\thgext.extdiff
=
16 echo \\t
\\tcmd.pcbdiff
= /PATH
/TO
/pcbdiff
17 echo \\tthen to invoke it
, do
18 echo \\thg pcbdiff ...
20 echo \\tTo use with subversion
, place it
in your PATH and
do
21 echo \\tsvn
diff --diff-cmd pcbdiff ...
23 echo \\tRequirements
: Imagemagick and gschem be installed
27 if test -z "${PCB}"; then
31 CONVERT
=`which convert`
32 if test -z "${CONVERT}"; then
36 COMPOSITE
=`which composite`
37 if test -z "${COMPOSITE}"; then
41 VIEWER
=`which display`
42 if test -z "${VIEWER}"; then
46 if test -z "${MISSING}"; then
49 echo "Binary for \"${MISSING}\" not found." >&2
50 echo "Either it is not installed, or not in your PATH" >&2
54 #In case the script was invoked with extra option arguments, throw them away
59 if test -d "${LEFTFILE}" -o -d "${RIGHTFILE}"
60 then echo "ERROR: pcbdiff cannot diff entire directories"
64 LEFTPNG
=`mktemp --tmpdir pcbdiff.XXXXXXXXXX`
65 RIGHTPNG
=`mktemp --tmpdir pcbdiff.XXXXXXXXXX`
66 LEFTBNW
=`mktemp --tmpdir pcbdiff.XXXXXXXXXX`
67 RIGHTBNW
=`mktemp --tmpdir pcbdiff.XXXXXXXXXX`
68 DIFFPNG
=`mktemp --tmpdir pcbdiff.XXXXXXXXXX`
70 "${PCB}" -x png --dpi ${PCBDIFF_DPI:-200} --photo-mode --outfile ${LEFTPNG} "${LEFTFILE}"
71 "${PCB}" -x png --dpi ${PCBDIFF_DPI:-200} --photo-mode --outfile ${RIGHTPNG} "${RIGHTFILE}"
72 "${CONVERT}" -colorspace gray
$LEFTPNG $LEFTBNW
73 "${CONVERT}" -colorspace gray
$RIGHTPNG $RIGHTBNW
74 "${COMPOSITE}" -stereo 0 $LEFTBNW $RIGHTBNW $DIFFPNG