apport 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #!/bin/sh -e
  2. #
  3. # apport: note if there are crash dumps available for apporting
  4. #
  5. # Copyright (C) 2009 Canonical Ltd.
  6. # Copyright (C) 2011-2014 Dustin Kirkland
  7. #
  8. # Authors: Dustin Kirkland <kirkland@byobu.org>
  9. #
  10. # This program is free software: you can redistribute it and/or modify
  11. # it under the terms of the GNU General Public License as published by
  12. # the Free Software Foundation, version 3 of the License.
  13. #
  14. # This program is distributed in the hope that it will be useful,
  15. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. # GNU General Public License for more details.
  18. #
  19. # You should have received a copy of the GNU General Public License
  20. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  21. __apport_detail() {
  22. for i in /var/crash/*.crash; do
  23. if [ -f "$i" ]; then
  24. printf "\nTo file bugs on the existing crash reports, run:\n"
  25. which apport-cli >/dev/null || printf " sudo apt-get install apport\n"
  26. for i in /var/crash/*.crash; do
  27. printf " apport-cli $i\n"
  28. done
  29. printf "\nTo clear the pending reports:\n"
  30. printf " rm -f /var/crash/*.crash\n\n"
  31. return
  32. fi
  33. done
  34. printf "No pending crash reports\n"
  35. }
  36. __apport() {
  37. # Print {!} if a /var/crash/*.crash file exists
  38. for i in /var/crash/*.crash; do
  39. if [ -f "$i" ]; then
  40. color y k; printf "{!}"; color --
  41. return
  42. fi
  43. done
  44. rm -f "$BYOBU_RUN_DIR/status.$BYOBU_BACKEND/apport"*
  45. }
  46. # vi: syntax=sh ts=4 noexpandtab