zuno / slackpkgplus

slackpkg+
57 stars 10 forks source link

Ideas for improving search results formatting #11

Closed edrozenberg closed 6 years ago

edrozenberg commented 6 years ago

I know there's been discussion in the past about the status labels to show, and how to format the columns for readability and cleanliness.

Currently the search output is quite verbose and often breaks lines due to length, making the output not as nice as it could be.

A few ideas in case they're helpful:

Using these ideas, some example output:

[i] clisp-2.49.20180203.ca011c249da5-x86_64-1                  (slackware64)  
[ ] chromium-dev-pepperflash-plugin-27.0.0.187-x86_64-1alien   (alienbob)  
[u] xf86-video-nouveau-1.0.15-x86_64-1 --> xf86-video-nouveau-blacklist-noarch-1 (extra)
[m] npapi-vlc-20171129-x86_64-1alien                           (alienbob) 

I tweaked the output lines as follows

            # If installed is it uptodate?
            if [ "${CINSTPKG}" = "${RAWNAME}" ]; then
              STATUS="x"
              printf "[%-1s] %-58s (%s)  \n" "$STATUS" "$CINSTPKG" "$REPO"
            else
              STATUS="u"
              printf "[%-1s] %-58s (%s)  \n" "$STATUS" "$CINSTPKG --> ${RAWNAME}" "$REPO"
            fi
          fi
        done
      else
        printf "[%-1s] %-58s (%s)  \n" "$STATUS" "${RAWNAME}" "$REPO"
      fi
edrozenberg commented 6 years ago

Also had to tweak the sort line with a -k2 to sort starting on the second field (package name):

done|sort -k2|( [[ "$CMD" == "search" ]]&&grep -E -i --color -e ^ -e "$PATTERN"||cat )

zuno commented 6 years ago

The best way for bug reports and feature requests il linuxquestions

https://www.linuxquestions.org/questions/slackware-14/slackpkg-vs-third-party-package-repository-4175427364/

I'm unsure to choice this way to reduce output format.

However there is a development release of slackpkg+ that reduce a lot the output without change it minimizing spaces.

To install that version replace checkrepos.sh from the master branch on github

edrozenberg commented 6 years ago

Thank you, I'll take a look at the changes being made in the latest dev.