From a89abd10bba6aeee4dec9a52856dd6aa6c51bb2c Mon Sep 17 00:00:00 2001 From: Andreas Gruenbacher Date: Sun, 2 Feb 2003 16:01:20 +0000 Subject: Add quilt diff --diff=... option (for tkdiff, etc.) --- quilt.changes | 5 +++++ quilt/diff.in | 23 ++++++++++++++++++++--- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/quilt.changes b/quilt.changes index 827ba4c..9ac64f0 100644 --- a/quilt.changes +++ b/quilt.changes @@ -3,6 +3,11 @@ Sun Feb 2 15:23:20 +0100 2003 - agruen@suse.de - Make quilt setup recognize the "# Sourcedir:" directive. - Fix bug with spurious `Index:' lines in diff/refresh output. +- Add --diff option to quilt diff that allows to specify a + different utility that diff to run files through. (That utility + is only called for files that contain differences, not for + files that are in a patches' file list but jave not been + changed.) ------------------------------------------------------------------- Sat Feb 1 18:52:15 +0100 2003 - agruen@suse.de diff --git a/quilt/diff.in b/quilt/diff.in index ac6ea9a..e764a5c 100644 --- a/quilt/diff.in +++ b/quilt/diff.in @@ -58,6 +58,20 @@ EOF fi } +do_diff() +{ + local file=$1 suffix=$2 old_file=$3 new_file=$4 + if [ -n "$opt_diff" ] + then + if ! @DIFF@ -q $old_file $new_file >/dev/null + then + $opt_diff $old_file $new_file + fi + else + diff_file $file $suffix $old_file $new_file + fi +} + die () { local status=$1 @@ -65,7 +79,7 @@ die () exit $status } -options=`getopt -o p:P:c:zh -- "$@"` +options=`getopt -o p:P:c:zh --long diff: -- "$@"` if [ $? -ne 0 ] then @@ -91,6 +105,9 @@ do shift ;; -h) usage -h ;; + --diff) + opt_diff=$2 + shift 2 ;; --) shift break ;; @@ -254,9 +271,9 @@ do suffix=".orig" fi old_file=$(backup_file_name $first_patch $file) - diff_file $file $suffix $old_file $new_file + do_diff $file $suffix $old_file $new_file else - diff_file $file ".orig" "$workdir/$file" $new_file + do_diff $file ".orig" "$workdir/$file" $new_file fi if [ $? -ne 0 ] -- cgit