From 470143bf8049f65e4f921349690a6b1d0af7446f Mon Sep 17 00:00:00 2001 From: Stefan Reinauer Date: Thu, 4 Jun 2026 08:00:19 -0700 Subject: [PATCH] packaging: add Debian install hooks Add Debian maintainer hooks for registering and removing desktop MIME metadata. This keeps package installs integrated with the desktop environment without requiring users to run update commands manually. --- .gitignore | 1 + packaging/debian/postinst | 16 ++++++++++++++++ packaging/debian/postrm | 18 ++++++++++++++++++ 3 files changed, 35 insertions(+) create mode 100755 packaging/debian/postinst create mode 100755 packaging/debian/postrm diff --git a/.gitignore b/.gitignore index ddf100eb..a187b804 100644 --- a/.gitignore +++ b/.gitignore @@ -54,6 +54,7 @@ decompress *.recipe packages packages.config +/.deps/ *.sqlite *.db-shm *.db-wal diff --git a/packaging/debian/postinst b/packaging/debian/postinst new file mode 100755 index 00000000..a1f994f7 --- /dev/null +++ b/packaging/debian/postinst @@ -0,0 +1,16 @@ +#!/bin/sh +set -e + +if [ "$1" = "configure" ]; then + if command -v update-desktop-database >/dev/null 2>&1; then + update-desktop-database -q /usr/share/applications || true + fi + if command -v update-mime-database >/dev/null 2>&1; then + update-mime-database /usr/share/mime || true + fi + if command -v gtk-update-icon-cache >/dev/null 2>&1; then + gtk-update-icon-cache -q -t -f /usr/share/icons/hicolor || true + fi +fi + +exit 0 diff --git a/packaging/debian/postrm b/packaging/debian/postrm new file mode 100755 index 00000000..d36625f0 --- /dev/null +++ b/packaging/debian/postrm @@ -0,0 +1,18 @@ +#!/bin/sh +set -e + +case "$1" in + remove|purge) + if command -v update-desktop-database >/dev/null 2>&1; then + update-desktop-database -q /usr/share/applications || true + fi + if command -v update-mime-database >/dev/null 2>&1; then + update-mime-database /usr/share/mime || true + fi + if command -v gtk-update-icon-cache >/dev/null 2>&1; then + gtk-update-icon-cache -q -t -f /usr/share/icons/hicolor || true + fi + ;; +esac + +exit 0 -- 2.47.3