From f4a19a469bb12611d6f994d4889711546237bce0 Mon Sep 17 00:00:00 2001 From: "chess.griffin" Date: Wed, 18 Feb 2009 15:08:24 +0000 Subject: [PATCH] implement some improvements to the diff patch previously committed; this one now includes DIFF and DIFFOPTS as two variables that can be set by the user; thanks to Phillip Warner for the suggestions, and for both Mauro Giachero and slakmagik for coming up with a good implementation. --- src/usr/bin/sbopkg | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/usr/bin/sbopkg b/src/usr/bin/sbopkg index a63caae..c5f9143 100755 --- a/src/usr/bin/sbopkg +++ b/src/usr/bin/sbopkg @@ -2116,6 +2116,9 @@ pick_file () { # This function checks to see if there is a locally-edited .info or # SlackBuild file (which has the *.sbopkg" suffix) and then asks the # user which one he wants to use to build a package. + # The user can also choose to view a diff of the two before choosing + # between them. + # DIFF defines the diff program used and DIFFOPTS the diff options. local FILE PKG PICKFILE ANS rm -f $TMP/sbopkg_file_selection $TMP/sbopkg_diff @@ -2137,7 +2140,8 @@ pick_file () { fi PICKFILE="original" if [[ -f $PKGPATH/$PKG.$FILE.sbopkg ]]; then - diff -u $PKGPATH/$PKG.$FILE{,.sbopkg} > $TMP/sbopkg_diff + ${DIFF:-diff} ${DIFFOPTS:--u} $PKGPATH/$PKG.$FILE{,.sbopkg} \ + > $TMP/sbopkg_diff fi if [[ -s $TMP/sbopkg_diff ]]; then if [ "$DIAG" = "1" ]; then @@ -2171,6 +2175,7 @@ pick_file () { done else while :; do + echo crunch_fmt "A local $FILE file for $PKG was found in \ addition to the original $FILE file." echo "Which one would you like to use?" @@ -2193,7 +2198,6 @@ pick_file () { ;; esac done - echo fi fi rm -f $TMP/sbopkg_diff