summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Allen <david.a58@optusnet.com.au>2017-10-21 00:39:13 -0500
committerRobby Workman <rworkman@slackware.com>2017-10-22 01:59:53 -0500
commit98c8ffda233e261e565b180a5388e233ce92363c (patch)
treeaab7379fcf18ac49105aa155eb65fa3de4d814fa
parent406e0e84f5321652fa1a539d80be6ca5df1ffb1b (diff)
downloadslackpkg-98c8ffda233e261e565b180a5388e233ce92363c.tar.xz
Allow using vimdiff to compare .new and original files
Signed-off-by: Robby Workman <rworkman@slackware.com>
-rw-r--r--files/post-functions.sh17
1 files changed, 16 insertions, 1 deletions
diff --git a/files/post-functions.sh b/files/post-functions.sh
index c286e7a..27f47c2 100644
--- a/files/post-functions.sh
+++ b/files/post-functions.sh
@@ -111,6 +111,18 @@ removeold() {
rm $i
}
+runvimdiff() {
+ BASENAME=$(basename $i .new)
+ FILEPATH=$(dirname $i)
+ FULLNAME="${FILEPATH}/${BASENAME}"
+
+ if [ -e ${FULLNAME} ]; then
+ vimdiff ${FULLNAME} ${FULLNAME}.new
+ else
+ echo "file $FULLNAME doesn't exist"
+ fi
+}
+
looknew() {
# with ONLY_NEW_DOTNEW set, slackpkg will search only for
@@ -166,7 +178,7 @@ What do you want (K/O/R/P)?"
GOEX=0
while [ $GOEX -eq 0 ]; do
echo
- showmenu $i "(K)eep" "(O)verwrite" "(R)emove" "(D)iff" "(M)erge"
+ showmenu $i "(K)eep" "(O)verwrite" "(R)emove" "(D)iff" "(M)erge" "(V)imdiff [dp put, do obtain, ^W^W switch]" showmenu $i "(K)eep" "(O)verwrite" "(R)emove" "(D)iff" "(M)erge"
read ANSWER
case $ANSWER in
O|o)
@@ -183,6 +195,9 @@ What do you want (K/O/R/P)?"
M|m)
mergenew $1
;;
+ V|v)
+ runvimdiff $1
+ ;;
K|k|*)
GOEX=1
;;