diff options
author | Aaron Griffin <aaron@archlinux.org> | 2007-02-23 09:03:50 +0100 |
---|---|---|
committer | Aaron Griffin <aaron@archlinux.org> | 2007-02-23 09:03:50 +0100 |
commit | 1dbe27814be661f987638cd868f55ef7c3a240b8 (patch) | |
tree | e56ca0305c31d4b8da5c4985fa22c4f7c8894385 /contrib | |
parent | 78ecf9a12bec098709c924552ee4f2b16c34c34a (diff) | |
download | pacman-1dbe27814be661f987638cd868f55ef7c3a240b8.tar.gz pacman-1dbe27814be661f987638cd868f55ef7c3a240b8.tar.xz |
I had this laying around, figured someone might find it useful
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/pacdiff | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/contrib/pacdiff b/contrib/pacdiff new file mode 100644 index 00000000..2ff431bb --- /dev/null +++ b/contrib/pacdiff @@ -0,0 +1,47 @@ +#!/bin/sh +# pacdiff : a simple pacnew/pacorig/pacsave updater for /etc/ +# +# Copyright (c) 2007 Aaron Griffin <aaronmgriffin@gmail.com> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, +# USA. +# + +# Original http://phraktured.net/config/bin/pacdiff + +diffprog=${DIFFPROG:-vimdiff} +for x in $(find /etc/ -name *.pacnew -o -name *.pacorig -o -name *.pacsave) +do + echo "File: ${x%.pac*}" + chk="$(cmp $x ${x%.pac*})" + if [ -z "${chk}" ]; then + echo " Files are identical, removing..." + rm $x + else + echo -n " File differences found. (V)iew, (S)kip, (R)emove: [v/s/r] " + read c + c="$(echo $c| tr A-Z a-z)" #tolower + if [ "$c" = "r" ]; then + rm $x + elif [ "$c" = "s" ]; then + continue + else + [ "$c" = "n" -o "$c" = "N" ] || $diffprog $x ${x%.pac*} + echo -n " Remove file? [Y/n] " + read c + [ "$c" = "n" -o "$c" = "N" ] || rm $x + fi + fi +done |