2 # pacdiff : a simple pacnew/pacorig/pacsave updater for /etc/
4 # Copyright (c) 2007 Aaron Griffin <aaronmgriffin@gmail.com>
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program. If not, see <http://www.gnu.org/licenses/>.
20 # Original http://phraktured.net/config/bin/pacdiff
22 diffprog
=${DIFFPROG:-vimdiff}
23 for x
in $
(find /etc
/ -name "*.pacnew" -o -name "*.pacorig" -o -name "*.pacsave")
25 echo "File: ${x%.pac*}"
26 chk
="$(cmp $x ${x%.pac*})"
27 if [ -z "${chk}" ]; then
28 echo " Files are identical, removing..."
31 echo -n " File differences found. (V)iew, (S)kip, (R)emove: [v/s/r] "
33 c
="$(echo $c| tr A-Z a-z)" #tolower
34 if [ "$c" = "r" ]; then
36 elif [ "$c" = "s" ]; then
39 [ "$c" = "n" -o "$c" = "N" ] ||
$diffprog $x ${x%.pac*}
40 echo -n " Remove file? [Y/n] "
42 [ "$c" = "n" -o "$c" = "N" ] ||
rm $x