From 647bc427421ef6ad03f8ec2d4a2aad6b6b6c4925 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Mon, 12 Mar 2012 00:40:12 -0400 Subject: [PATCH] etc-update: ignore changes in whitespace (-b) for automerge Signed-off-by: Mike Frysinger --- bin/etc-update | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/bin/etc-update b/bin/etc-update index 75c6ba1b5..135de4557 100755 --- a/bin/etc-update +++ b/bin/etc-update @@ -124,18 +124,16 @@ scan() { else diff -Bbua "${cfg_file}" "${live_file}" | \ sed -n -r \ - -e '/^[+-]/{/^([+-][\t ]*(#|$)|-{3} |\+{3} )/d;q0}' \ - -e '$q1' - MATCHES=$? + -e '/^[+-]/{/^([+-][\t ]*(#|$)|-{3} |\+{3} )/d;q1}' + : $(( MATCHES = ($? == 0) )) fi - elif diff -Nua "${cfg_file}" "${live_file}" | - sed -n \ - -e '/# .Header:/d' \ - -e '/^[+-][^+-]/q1' \ - -e '$q0' - then - MATCHES=1 + else + diff -Nbua "${cfg_file}" "${live_file}" | + sed -n \ + -e '/# .Header:/d' \ + -e '/^[+-][^+-]/q1' + : $(( MATCHES = ($? == 0) )) fi if [[ ${MATCHES} == 1 ]] ; then @@ -152,18 +150,17 @@ scan() { fi fi - if diff -Nua "${cfg_file}" "${rpath}/${ofile}" | + if ! diff -Nbua "${cfg_file}" "${rpath}/${ofile}" | sed -n \ -e '/# .Header:/d' \ - -e '/^[+-][^+-]/q1' \ - -e '$q0' + -e '/^[+-][^+-]/q1' then - mv "${cfg_file}" "${rpath}/${ofile}" - continue - else echo "${cfg_file}" >> "${TMP}"/files/${count} ofile="${rfile}" opath="${rpath}" + else + mv "${cfg_file}" "${rpath}/${ofile}" + continue fi done done -- 2.26.2