xzdiff | xzdiff | |||
---|---|---|---|---|
skipping to change at line 32 | skipping to change at line 32 | |||
# specified via XZ_OPT. With gzip, bzip2, and lzop it's OK to just unset th e | # specified via XZ_OPT. With gzip, bzip2, and lzop it's OK to just unset th e | |||
# environment variables. | # environment variables. | |||
xz='xz --format=auto' | xz='xz --format=auto' | |||
unset GZIP BZIP BZIP2 LZOP | unset GZIP BZIP BZIP2 LZOP | |||
case ${0##*/} in | case ${0##*/} in | |||
*cmp*) prog=xzcmp; cmp=${CMP:-cmp};; | *cmp*) prog=xzcmp; cmp=${CMP:-cmp};; | |||
*) prog=xzdiff; cmp=${DIFF:-diff};; | *) prog=xzdiff; cmp=${DIFF:-diff};; | |||
esac | esac | |||
version="$prog (XZ Utils) 5.1.2alpha" | version="$prog (XZ Utils) 5.2.0" | |||
usage="Usage: ${0##*/} [OPTION]... FILE1 [FILE2] | usage="Usage: ${0##*/} [OPTION]... FILE1 [FILE2] | |||
Compare FILE1 to FILE2, using their uncompressed contents if they are | Compare FILE1 to FILE2, using their uncompressed contents if they are | |||
compressed. If FILE2 is omitted, then the files compared are FILE1 and | compressed. If FILE2 is omitted, then the files compared are FILE1 and | |||
FILE1 from which the compression format suffix has been stripped. | FILE1 from which the compression format suffix has been stripped. | |||
Do comparisons like '$cmp' does. OPTIONs are the same as for '$cmp'. | Do comparisons like '$cmp' does. OPTIONs are the same as for '$cmp'. | |||
Report bugs to <lasse.collin@tukaani.org>." | Report bugs to <lasse.collin@tukaani.org>." | |||
skipping to change at line 139 | skipping to change at line 139 | |||
cmp_status=$? | cmp_status=$? | |||
case $xz_status in | case $xz_status in | |||
*[1-9]*) xz_status=1;; | *[1-9]*) xz_status=1;; | |||
*) xz_status=0;; | *) xz_status=0;; | |||
esac | esac | |||
(exit $cmp_status) | (exit $cmp_status) | |||
else | else | |||
F=`expr "/$2" : '.*/\(.*\)[-.][ablmotxz2]*$'` || F=$prog | F=`expr "/$2" : '.*/\(.*\)[-.][ablmotxz2]*$'` || F=$prog | |||
tmp= | tmp= | |||
trap ' | trap ' | |||
test -n "$tmp" && rm -f "$tmp" | test -n "$tmp" && rm -rf "$tmp" | |||
(exit 2); exit 2 | (exit 2); exit 2 | |||
' HUP INT PIPE TERM 0 | ' HUP INT PIPE TERM 0 | |||
tmp=`mktemp -t -- "$F.XXXXXX"` || exit 2 | if type mktemp >/dev/null 2>&1; then | |||
$xz2 -cdfq -- "$2" > "$tmp" || exit 2 | tmp=`mktemp -t -d -- "$prog.XXXXXXXXXX"` || exit 2 | |||
else | ||||
# Fallback code if mktemp is missing. This isn't as | ||||
# robust as using mktemp since this doesn't try with | ||||
# different file names in case of a file name conflict. | ||||
# | ||||
# There's no need to save the original umask since | ||||
# we don't create any non-temp files. Note that using | ||||
# mkdir -m 0077 isn't secure since some mkdir implementations | ||||
# create the dir with the default umask and chmod the | ||||
# the dir afterwards. | ||||
umask 0077 | ||||
mkdir -- "${TMPDIR-/tmp}/$prog.$$" || exit 2 | ||||
tmp="${TMPDIR-/tmp}/$prog.$$" | ||||
fi | ||||
$xz2 -cdfq -- "$2" > "$tmp/$F" || exit 2 | ||||
xz_status=$( | xz_status=$( | |||
exec 4>&1 | exec 4>&1 | |||
($xz1 -cdfq -- "$1" 4>&-; echo $? >&4) 3>&- | | ($xz1 -cdfq -- "$1" 4>&-; echo $? >&4) 3>&- | | |||
eval "$cmp" - '"$tmp"' >&3 | eval "$cmp" - '"$tmp/$F"' >&3 | |||
) | ) | |||
cmp_status=$? | cmp_status=$? | |||
rm -f "$tmp" || xz_status=$? | rm -rf "$tmp" || xz_status=$? | |||
trap - HUP INT PIPE TERM 0 | trap - HUP INT PIPE TERM 0 | |||
(exit $cmp_status) | (exit $cmp_status) | |||
fi;; | fi;; | |||
*) | *) | |||
xz_status=$( | xz_status=$( | |||
exec 4>&1 | exec 4>&1 | |||
($xz1 -cdfq -- "$1" 4>&-; echo $? >&4) 3>&- | | ($xz1 -cdfq -- "$1" 4>&-; echo $? >&4) 3>&- | | |||
eval "$cmp" - '"$2"' >&3 | eval "$cmp" - '"$2"' >&3 | |||
);; | );; | |||
esac;; | esac;; | |||
End of changes. 5 change blocks. | ||||
6 lines changed or deleted | 21 lines changed or added | |||
This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/ |