diff --git a/files/post-functions.sh b/files/post-functions.sh index 9fd483a..a9f86f8 100644 --- a/files/post-functions.sh +++ b/files/post-functions.sh @@ -124,6 +124,10 @@ runvimdiff() { } looknew() { + local ROWS SIZE FILES PROMPTTEXT TEXTLINES MAXROWS + local newcount f n fn + f=0 + n=0 # with ONLY_NEW_DOTNEW set, slackpkg will search only for # .new files installed in actual slackpkg's execution @@ -133,10 +137,6 @@ looknew() { ONLY_NEW_DOTNEW="" fi - SIZE=$( stty size ) - ROWS=${SIZE% *} - LISTMAX=$(( ROWS - 10 )) - printf "%s\n" "Searching for NEW configuration files..." FILES=$( find \ @@ -154,53 +154,91 @@ looknew() { if [ -n "$FILES" ]; then newcount=$( echo "$FILES" | wc -l ) + SIZE=$( stty size ) + ROWS=${SIZE% *} - printf "%s %s\n\n" "Some packages had new configuration" \ - "files installed ($newcount new files):" - - if [ $newcount -le $LISTMAX ]; then - echo "$FILES" - else - F=0 - N=0 - for FN in $FILES; do - F=$(( F + 1 )) - N=$(( N + 1 )) - echo "$N $FN" - - if [ $F -ge $(( ROWS - 5 )) ]; then - F=0 - IFS=$( printf "\n" ) read -rn 1 \ - -p " -Press SPACE for more, ENTER to skip" junk - printf "\n" - tput -S <