postinst.in 875 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #!/bin/sh
  2. # vim:set fileencoding=utf-8 et ts=4 sts=4 sw=4:
  3. set -e
  4. PREFERENCES=/etc/apt/listchanges.conf
  5. . /usr/share/debconf/confmodule
  6. runPython()
  7. {
  8. temp=`tempfile -p aptlc -s .py`
  9. trap "rm -f $temp" EXIT
  10. cat > "$temp" << 'EOF'
  11. #DEBCONF_HELPER_PY#
  12. EOF
  13. python3 -B "$temp" "$@"
  14. }
  15. if [ "$1" = "configure" ]
  16. then
  17. runPython postinst "$PREFERENCES" "$@"
  18. ucfr 'apt-listchanges' "$PREFERENCES"
  19. # Ignore whitespace-only difference (see #823514)
  20. diff -qwB "$PREFERENCES".new "$PREFERENCES" >/dev/null 2>&1 || \
  21. ucf --debconf-ok "$PREFERENCES".new "$PREFERENCES"
  22. rm -f "$PREFERENCES".new
  23. fi
  24. [ -z "$DEBCONF_RECONFIGURE" ] || exit 0
  25. # Fix a bug introduced in 3.0
  26. dbfile=/var/lib/apt/listchanges.db
  27. if [ "$1" = "configure" ] && [ "$2" = "3.0" ] && [ "$dbfile.db" -nt "$dbfile" ]; then
  28. mv -f "$dbfile.db" "$dbfile"
  29. fi
  30. #DEBHELPER#