/usr/bin/silodiff is in libsilo-bin 4.8-11.
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 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 | #!/bin/sh
# Copyright (c) 1994 - 2010, Lawrence Livermore National Security, LLC.
# LLNL-CODE-425250.
# All rights reserved.
#
# This file is part of Silo. For details, see silo.llnl.gov.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the disclaimer below.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the disclaimer (as noted
# below) in the documentation and/or other materials provided with
# the distribution.
# * Neither the name of the LLNS/LLNL nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL LAWRENCE
# LIVERMORE NATIONAL SECURITY, LLC, THE U.S. DEPARTMENT OF ENERGY OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# This work was produced at Lawrence Livermore National Laboratory under
# Contract No. DE-AC52-07NA27344 with the DOE. Neither the United
# States Government nor Lawrence Livermore National Security, LLC nor
# any of their employees, makes any warranty, express or implied, or
# assumes any liability or responsibility for the accuracy,
# completeness, or usefulness of any information, apparatus, product, or
# process disclosed, or represents that its use would not infringe
# privately-owned rights. Any reference herein to any specific
# commercial products, process, or services by trade name, trademark,
# manufacturer or otherwise does not necessarily constitute or imply its
# endorsement, recommendation, or favoring by the United States
# Government or Lawrence Livermore National Security, LLC. The views and
# opinions of authors expressed herein do not necessarily state or
# reflect those of the United States Government or Lawrence Livermore
# National Security, LLC, and shall not be used for advertising or
# product endorsement purposes.
# ----------------------------------------------------------------------------
# Purpose: Difference two silo files and/or directories containing silo files
#
# Programmer: Mark C. Miller
# Creation: January 21, 2009
#
# Modifications:
# Mark C. Miller, Wed Mar 11 10:03:10 PDT 2009
# Added browserOptsDef and set lowlevel to 0. That is important when
# diff'ing HDF5 files.
#
# Mark C. Miller, Wed Dec 2 11:47:31 PST 2009
# Added logic to use path to browser that is 'next to' silodiff or fall
# back what a browser in path, but issue a warning if they are somehow
# different.
#
# Mark C. Miller, Fri Dec 4 09:58:17 PST 2009
# Made it possible to override browser path warning
# ----------------------------------------------------------------------------
#
#
# Handle Command Line Arguments
#
tmpDir=$TMPDIR
if test -z "$tmpDir"; then
if test -d /usr/tmp; then
tmpDir=/usr/tmp
elif test -d /tmp; then
tmpDir=/tmp
else
tmpDir=`(cd ~; pwd -P)`
fi
fi
optError=0
browserOptsDef="-l 0 -r"
browserOpts=""
arg1=
arg2=
recurse=0
verbose=0
override=0
for options
do
case $1 in
"")
# handle empty argument
;;
help|-help|--help)
optError=1
shift
;;
-recurse|--recurse)
recurse=1
shift
;;
-verbose|--verbose)
verbose=1
shift
;;
-override-browser-warning|--override-browser-warning)
override=1
shift
;;
*)
if test -e $1; then
if test -z "$arg1"; then
arg1=$1
else
arg2=$1
fi
else
browserOpts="$browserOpts $1"
fi
shift
;;
esac
done
#
# Check path to browser and issue error/warning if necessary
#
brexe=browser
sddir=$(dirname $0)
if test -x ${sddir}/browser; then
brexe=${sddir}/browser
else
brdir=$(dirname $(which browser))
if test $brdir != $sddir; then
leader="*WARNING*"
if test $override -eq 0; then
leader="*ERROR*"
fi
echo "$leader"
echo "$leader Using browser at \"$brdir\"."
echo "$leader and silodiff at \"$sddir\"."
echo "$leader"
if test $override -eq 0; then
echo "$leader Override with \"--override-browser-warning\" option."
exit 1
fi
fi
fi
if test $optError = 1 -o -z "$arg1" -o -z "$arg2"; then
echo "Usage: $0 <file|dir> <file|dir> <options>"
echo ""
echo "Options:"
echo " -help: print this help message"
echo " -recurse: recurse on directories"
echo " -verbose: report names of file(s) as they are processed."
echo ""
echo "If both arguments are files, $0 will attempt to diff the files."
echo ""
echo "If one argument is a file and the other a directory, then $0 will attempt"
echo "to diff the given file with a file by the same name in the given directory."
echo ""
echo "If both arguments are directories, $0 will descend into each directory"
echo "(and will do so recursively if '-recurse' is specified) finding files"
echo "whose names differ ONLY in the first component of their paths and attempt"
echo "to diff them."
echo ""
echo "$0 uses Silo's browser tool to do its work. In turn, browser supports a"
echo "number of additional options. Thus, any arguments to $0 which are neither"
echo "files nor directories are treated as arguments to browser itself. For some"
echo "options to browser like the '-f FILE' option, use the '--file=<FILE>'"
echo "variant instead. By default, $0 will invoke browser with args"
echo "'$browserOptsDef'. The available options to browser are..."
echo ""
$brexe --help 2>&1 | grep -v SWITCHES
exit 1
fi
if test -d $arg1 -a -d $arg2; then # both are dirs
for f in $arg1/*; do
if test -d $f; then
df=`echo $f | rev | cut -d'/' -f1 | rev`
if test $recurse = 1; then
if test -d $arg2/$df; then
if test $verbose = 1; then
echo "Processing directory \"$df\"..."
$0 -recurse -verbose $browserOpts $f $arg2/$df
else
$0 -recurse $browserOpts $f $arg2/$df
fi
else
test $verbose = 1 && echo "Directory \"$df\" does not exist in \"$arg2\", skipping it."
fi
else
test $verbose = 1 && echo "\"$df\" is a directory, skipping it. Use -recurse to process directories."
fi
else
bf=`basename $f`
if test -e $arg2/$bf; then
test $verbose = 1 && echo "Processing file \"$bf\"..."
$brexe $browserOptsDef $browserOpts -e diff $f $arg2/$bf
else
test $verbose = 1 && echo "File \"$bf\" does not exist in \"$arg2\", skipping it."
fi
fi
done
elif test -d $arg1 -o -d $arg2; then # one is dir
if test -d $arg1; then
$brexe $browserOptsDef $browserOpts -e diff $arg1/$arg2 $arg2
else
$brexe $browserOptsDef $browserOpts -e diff $arg1 $arg2/$arg1
fi
else # neither are dirs
$brexe $browserOptsDef $browserOpts -e diff $arg1 $arg2
fi
|