pacdiff: Add option to overwrite, clarify remove option

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:22:22 +01:00 committed by Allan McRae
parent 495460d717
commit 163ba4016e
1 changed files with 3 additions and 2 deletions

View File

@ -97,15 +97,16 @@ while IFS= read -u 3 -r -d '' pacfile; do
echo " Files are identical, removing..."
rm -v "$pacfile"
else
echo -n " File differences found. (V)iew, (S)kip, (R)emove: [v/s/r] "
printf " (V)iew, (S)kip, (R)emove %s, (O)verwrite with %s: [v/s/r/o] " "$file_type" "$file_type"
while read c; do
case $c in
r|R) rm -v "$pacfile"; break ;;
o|O) mv -v "$pacfile" "$file"; break ;;
v|V)
$diffprog "$pacfile" "$file"
rm -iv "$pacfile"; break ;;
s|S) break ;;
*) echo -n " Invalid answer. Try again: [v/s/r] "; continue ;;
*) printf " Invalid answer. Try again: [v/s/r/o] "; continue ;;
esac
done
fi