dpkg.postinst 729 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #!/bin/sh
  2. # See deb-postinst(5).
  3. set -e
  4. # Create the database files if they don't already exist
  5. create_database() {
  6. admindir=${DPKG_ADMINDIR:-/var/lib/dpkg}
  7. for file in diversions statoverride status; do
  8. if [ ! -f "$admindir/$file" ]; then
  9. touch "$admindir/$file"
  10. fi
  11. done
  12. }
  13. # Create log file and set default permissions if possible
  14. create_logfile() {
  15. logfile=/var/log/dpkg.log
  16. touch $logfile
  17. chmod 644 $logfile
  18. chown root:root $logfile 2>/dev/null || chown 0:0 $logfile
  19. }
  20. case "$1" in
  21. configure)
  22. create_database
  23. create_logfile
  24. ;;
  25. abort-upgrade|abort-deconfigure|abort-remove)
  26. ;;
  27. *)
  28. echo "$0 called with unknown argument '$1'" 1>&2
  29. exit 1
  30. ;;
  31. esac
  32. #DEBHELPER#
  33. exit 0