This file is indexed.

/usr/share/pcb/tools/pcbdiff is in pcb-common 20140316-3.

This file is owned by root:root, with mode 0o755.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#! /bin/sh

usage ()
{
  echo Usage: 
  echo \\tpcbdiff firstfile secondfile
  echo \\tView a graphical diff of PCB files
  echo
  echo \\tTo use with git, just place this script in your PATH and do
  echo \\tgit difftool -x pcbdiff ...
  echo
  echo \\tTo use with mercurial, add the following lines to your .hgrc:
  echo \\t\\t[extensions]
  echo \\t\\thgext.extdiff =
  echo \\t\\t[extdiff]
  echo \\t\\tcmd.pcbdiff = /PATH/TO/pcbdiff
  echo \\tthen to invoke it, do
  echo \\thg pcbdiff ...
  echo
  echo \\tTo use with subversion, place it in your PATH and do
  echo \\tsvn diff --diff-cmd pcbdiff ...

  echo \\tRequirements: Imagemagick and gschem be installed
}

PCB=`which pcb`
if test -z "${PCB}"; then
  MISSING=pcb
fi

CONVERT=`which convert`
if test -z "${CONVERT}"; then
  MISSING=convert
fi

COMPOSITE=`which composite`
if test -z "${COMPOSITE}"; then
  MISSING=composite
fi

VIEWER=`which display`
if test -z "${VIEWER}"; then
  MISSING=display
fi

if test -z "${MISSING}"; then
  true
else
  echo "Binary for \"${MISSING}\" not found." >&2
  echo "Either it is not installed, or not in your PATH" >&2
  exit 1
fi

#In case the script was invoked with extra option arguments, throw them away
shift `expr $# - 2`

LEFTFILE="${1}"
RIGHTFILE="${2}"
if test -d "${LEFTFILE}" -o -d "${RIGHTFILE}"
  then echo "ERROR: pcbdiff cannot diff entire directories"
  exit 1
fi

LEFTPNG=`mktemp --tmpdir pcbdiff.XXXXXXXXXX`
RIGHTPNG=`mktemp --tmpdir pcbdiff.XXXXXXXXXX`
LEFTBNW=`mktemp --tmpdir pcbdiff.XXXXXXXXXX`
RIGHTBNW=`mktemp --tmpdir pcbdiff.XXXXXXXXXX`
DIFFPNG=`mktemp --tmpdir pcbdiff.XXXXXXXXXX`

"${PCB}" -x png --dpi ${PCBDIFF_DPI:-200} --photo-mode --outfile ${LEFTPNG} "${LEFTFILE}"
"${PCB}" -x png --dpi ${PCBDIFF_DPI:-200} --photo-mode --outfile ${RIGHTPNG} "${RIGHTFILE}"
"${CONVERT}" -colorspace gray $LEFTPNG $LEFTBNW
"${CONVERT}" -colorspace gray $RIGHTPNG $RIGHTBNW
"${COMPOSITE}" -stereo 0 $LEFTBNW $RIGHTBNW $DIFFPNG
"${VIEWER}" $DIFFPNG
rm $LEFTPNG
rm $RIGHTPNG
rm $LEFTBNW
rm $RIGHTBNW
rm $DIFFPNG