show_installed_version_diffs.sh 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #!/bin/sh
  2. #called from ui_Classic and ui_Ziggy, after running findnames.sh.
  3. #120908 script created.
  4. #130511 pkg_chooser.sh has created layers-installed-packages (use instead of woof-installed-packages).
  5. export TEXTDOMAIN=petget___versiondiffs
  6. export OUTPUT_CHARSET=UTF-8
  7. #created by findnames.sh...
  8. [ ! -s /tmp/petget/filterpkgs.results.installed ] && exit
  9. #120908 "ALREADY INSTALLED" may not be helpful, as the versions may differ. display these...
  10. DIFFVERITEMS=""
  11. for ONEALREADYINSTALLED in `cut -f 1,2,3 -d '|' /tmp/petget/filterpkgs.results.installed`
  12. do
  13. #ex: langpack_de-20120718|langpack_de|20120718
  14. ONEPKG="$(echo -n "$ONEALREADYINSTALLED" | cut -f 1 -d '|')"
  15. ONENAMEONLY="$(echo -n "$ONEALREADYINSTALLED" | cut -f 2 -d '|')"
  16. ONEVERSION="$(echo -n "$ONEALREADYINSTALLED" | cut -f 3 -d '|')"
  17. onoPTN="|${ONENAMEONLY}|"
  18. INSTALLEDPKGS="$(cat /root/.packages/layers-installed-packages /root/.packages/user-installed-packages | grep "$onoPTN" | cut -f 1,3 -d '|' | tr '\n' ' ')"
  19. for AINSTALLEDPKG in $INSTALLEDPKGS
  20. do
  21. AIPKG="$(echo -n "$AINSTALLEDPKG" | cut -f 1 -d '|')"
  22. AIVER="$(echo -n "$AINSTALLEDPKG" | cut -f 2 -d '|')"
  23. if ! vercmp $AIVER eq $ONEVERSION;then
  24. DIFFVERITEMS="${DIFFVERITEMS}<item>${ONEPKG}|${AIPKG}</item>"
  25. fi
  26. done
  27. done
  28. [ "$DIFFVERITEMS" = "" ] && exit
  29. export MAIN_DIALOG="<window title=\"$(gettext 'PPM: version differences')\" icon-name=\"gtk-about\">
  30. <vbox>
  31. <text>
  32. <label>$(gettext "Normally in the PPM main window, if a package, regardless of version, is already installed, it will not be listed. HOWEVER, the output of a search lists all matching packages, including installed, and identifies already-installed packages with the text 'ALREADY INSTALLED' and a 'tick' icon.")</label>
  33. </text>
  34. <text>
  35. <label>$(gettext "If a package found by a search is a different version than already installed, it is listed below. Please do not install such packages unless there is a particular reason to do so.")</label>
  36. </text>
  37. <table>
  38. <label>$(gettext 'Found package')|$(gettext 'Installed package')</label>
  39. ${DIFFVERITEMS}
  40. </table>
  41. <hbox>
  42. <button ok></button>
  43. </hbox>
  44. </vbox>
  45. </window>"
  46. gtkdialog4 --program=MAIN_DIALOG