/etckeeper/list-installed.d/50list-installed

http://github.com/brinkman83/bashrc · Shell · 10 lines · 6 code · 0 blank · 4 comment · 1 complexity · a109b32e05c3a2e2490c096399675abc MD5 · raw file

  1. #!/bin/sh
  2. # Output to stdout a *sorted* list of all currently installed
  3. # (or removed but still with config-files) packages, in the
  4. # format "package version\n" (or something similar).
  5. if [ "$LOWLEVEL_PACKAGE_MANAGER" = dpkg ]; then
  6. dpkg-query -W -f '${Status}\t${Package} ${Version}\n' | \
  7. egrep '(ok installed|ok config-files)' | cut -f2,3
  8. elif [ "$LOWLEVEL_PACKAGE_MANAGER" = rpm ]; then
  9. rpm -qa --queryformat "%{name} %{version} %{arch}\n" | sort
  10. fi