#1135838 odoo: please register & purge the volatile files using dh-cruft

#1135838#5
Date:
2026-05-06 13:00:09 UTC
From:
To:
Dear Maintainer,

Please consider this patch that moves here the burden
to track odoo major versions bumps.

I'm currenlty maintaining this has an heuristic
in the cruft-ng tool override database:

https://salsa.debian.org/pkg-security-team/cruft-ng/-/commit/c049f8eb582503f3e5b9071e07061fff1a3853be



Here's a glimples at the newly generated postrm script:

  #!/bin/sh
  set -e

  ODOO_USER="odoo"
  ODOO_GROUP="odoo"

  case "${1}" in
      remove)
          deluser --quiet --system $ODOO_USER || true
          delgroup --quiet --system --only-if-empty $ODOO_GROUP || true
          ;;

      purge)
          ;;

      upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
          ;;

  esac

  # Automatically added by dh_installinit/13.31
  if [ "$1" = "remove" ] && [ -x "/etc/init.d/odoo" ] ; then
          chmod -x "/etc/init.d/odoo" >/dev/null || true
  fi
  if [ -z "$DPKG_ROOT" ] && [ "$1" = "purge" ] ; then
          update-rc.d odoo remove >/dev/null
  fi
  # End automatically added section
  # Automatically added by dh_cruft/0.9.80
  if [ "$1" = "purge" ]
  then
      # we need to glob, so no quotes
      rm -rf ${DPKG_ROOT:-}/var/lib/odoo/
      rm -rf ${DPKG_ROOT:-}/var/log/odoo/
  fi
  # End automatically added section




dh-cruft has been available (& unchanged) for many years now, since 2022,
so this change won't hurt backportability.

Greetings

Alexandre
--- a/debian/control
+++ b/debian/control
@@ -3,7 +3,13 @@ Section: net
 Priority: optional
 Maintainer: Freexian Packaging Team <team+freexian@tracker.debian.org>
 Uploaders: Sebastien Delafond <seb@debian.org>
-Build-Depends: debhelper-compat (= 12), dh-python, python3, rsync, python3-setuptools
+Build-Depends:
+ debhelper-compat (= 12),
+ dh-python,
+ dh-sequence-cruft,
+ python3,
+ python3-setuptools,
+ rsync,
 Standards-Version: 4.7.0
 Homepage: http://www.odoo.com/
 Vcs-Git: https://salsa.debian.org/freexian-team/packages/odoo.git
--- a/debian/postrm
+++ b/debian/postrm
@@ -2,8 +2,6 @@

 set -e