pacdiff: be more verbose if we rename or remove

Doesn't hurt and reassures the user that we did the right thing.

Signed-off-by: Florian Pritz <bluewind@xinu.at>
Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
Florian Pritz 2012-12-19 23:21:06 +01:00 committed by Allan McRae
parent dd3762edc4
commit 6a804d55dd

View file

@ -89,21 +89,21 @@ while IFS= read -u 3 -r -d '' pacfile; do
printf " file found for $PURPLE%s$ALL_OFF\n" "$file" printf " file found for $PURPLE%s$ALL_OFF\n" "$file"
if [ ! -f "$file" ]; then if [ ! -f "$file" ]; then
echo " $file does not exist" echo " $file does not exist"
rm -i "$pacfile" rm -iv "$pacfile"
continue continue
fi fi
check="$(cmp "$pacfile" "$file")" check="$(cmp "$pacfile" "$file")"
if [ -z "${check}" ]; then if [ -z "${check}" ]; then
echo " Files are identical, removing..." echo " Files are identical, removing..."
rm "$pacfile" rm -v "$pacfile"
else else
echo -n " File differences found. (V)iew, (S)kip, (R)emove: [v/s/r] " echo -n " File differences found. (V)iew, (S)kip, (R)emove: [v/s/r] "
while read c; do while read c; do
case $c in case $c in
r|R) rm "$pacfile"; break ;; r|R) rm -v "$pacfile"; break ;;
v|V) v|V)
$diffprog "$pacfile" "$file" $diffprog "$pacfile" "$file"
rm -i "$pacfile"; break ;; rm -iv "$pacfile"; break ;;
s|S) break ;; s|S) break ;;
*) echo -n " Invalid answer. Try again: [v/s/r] "; continue ;; *) echo -n " Invalid answer. Try again: [v/s/r] "; continue ;;
esac esac