summaryrefslogtreecommitdiffstats
path: root/files/post-functions.sh
diff options
context:
space:
mode:
authorDave Woodfall <dave@dawoodfall.net>2018-10-18 18:56:42 +0000
committerRobby Workman <rworkman@slackware.com>2018-11-18 00:07:54 -0600
commit8ff792f2ef0d6500a5fc9e3d8a665f81a3efc22c (patch)
tree9d9e70f6fc14740b3a2f3e3d12db3c4a0793096d /files/post-functions.sh
parent8bd2393f0e0e2dc3e5113340f3f36241f407508b (diff)
downloadslackpkg-8ff792f2ef0d6500a5fc9e3d8a665f81a3efc22c.tar.xz
Add support for listing .new files without PAGER
Signed-off-by: Robby Workman <rworkman@slackware.com>
Diffstat (limited to 'files/post-functions.sh')
-rw-r--r--files/post-functions.sh40
1 files changed, 33 insertions, 7 deletions
diff --git a/files/post-functions.sh b/files/post-functions.sh
index ca61b2d..eb70ea5 100644
--- a/files/post-functions.sh
+++ b/files/post-functions.sh
@@ -141,8 +141,34 @@ looknew() {
-not -name "shadow.new" \
-not -name "gshadow.new" 2>/dev/null | sort 2>/dev/null)
if [ "$FILES" != "" ]; then
+ newcount=$(echo "$FILES" | wc -l)
+ echo -ne "\n\
+Some packages had new configuration files installed ($newcount new files):\n\n"
+
+ if [ $newcount -le 15 ]; then
+ echo -e "\n$FILES\n"
+ else
+ F=0
+ for FN in $FILES; do
+ F=$((F+1))
+ echo "$FN"
+
+ if [ $F -ge 14 ]; then
+ F=0
+ echo -ne "\nPress SPACE for more, ENTER to skip"
+ IFS=$'\n' read -rn 1 junk
+ echo -e "\n"
+
+ if [ "$junk" = " " ]; then
+ continue
+ elif [ "$junk" = "" ]; then
+ break
+ fi
+ fi
+ done
+ fi
+
echo -ne "\n\
-Some packages had new configuration files installed.
You have four choices:
(K)eep the old files and consider .new files later
@@ -154,9 +180,9 @@ You have four choices:
(R)emove all .new files
(P)rompt K, O, R selection for every single file
-
+
What do you want (K/O/R/P)?"
- answer
+ answer
case $ANSWER in
K|k)
break
@@ -179,7 +205,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" "(V)imdiff"
+ showmenu $i "(K)eep" "(O)verwrite" "(R)emove" "(D)iff" "(M)erge" "(V)imdiff"
read ANSWER
case $ANSWER in
O|o)
@@ -196,9 +222,9 @@ What do you want (K/O/R/P)?"
M|m)
mergenew $1
;;
- V|v)
- runvimdiff $1
- ;;
+ V|v)
+ runvimdiff $1
+ ;;
K|k|*)
GOEX=1
;;