summaryrefslogtreecommitdiffstats
path: root/bin/etc-update
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2012-03-12 00:40:12 -0400
committerMike Frysinger <vapier@gentoo.org>2012-03-12 00:40:25 -0400
commit647bc427421ef6ad03f8ec2d4a2aad6b6b6c4925 (patch)
tree0017fad04506a50e246d594acacbfb1b2bf1e27a /bin/etc-update
parent6e4f1bd23cbb3332fa1d4f1e570420b743e01296 (diff)
downloadportage-647bc427421ef6ad03f8ec2d4a2aad6b6b6c4925.tar.gz
portage-647bc427421ef6ad03f8ec2d4a2aad6b6b6c4925.tar.bz2
portage-647bc427421ef6ad03f8ec2d4a2aad6b6b6c4925.zip
etc-update: ignore changes in whitespace (-b) for automerge
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'bin/etc-update')
-rwxr-xr-xbin/etc-update29
1 files 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