Package: release.debian.org
Severity: normal
Tags: bookworm
User: release.debian....@packages.debian.org
Usertags: pu
X-Debbugs-Cc: gib...@debian.org, richard.lewis.deb...@googlemail.com
Control: affects -1 + src:logcheck

[ Reason ]
The version of logcheck in bookworm does not respect the removal of
/etc/logcheck/header.txt in bullseye prior to updating to bookworm.
Originally reported in bug #1049412, fixed by logcheck 1.4.4 uploaded
to unstable yesterday.

While likely academic at this point in the bookworm lifecycle, it's a
fairly easy fix to include.

[ Impact ]
There's currently a minor regression for users upgrading from bullseye
to bookworm who had previously removed /etc/logcheck/header.txt.

[ Tests ]
I have tested the bullseye->proposed-bookworm-update->trixie->sid
upgrade path, both with and without removing the header.txt file, and
verified it remains deleted if removed prior to starting the upgrade
path.

[ Risks ]
Minor/none -- logic was added to logcheck's pre/postinst scripts to
handle the removal of /etc/logcheck/header.txt.

[ Checklist ]
  [*] *all* changes are documented in the d/changelog
  [*] I reviewed all changes and I approve them
  [*] attach debdiff against the package in (old)stable
  [*] the issue is verified as fixed in unstable

[ Changes ]
Cherry-pick relevant fix from unstable commit
8cc01d30a3156eaa2f21b14e468eccd0b0666c3c.

[ Other info ]
The source debdiff is attached.
diff -Nru logcheck-1.4.2/debian/changelog logcheck-1.4.2+deb12u1/debian/changelog
--- logcheck-1.4.2/debian/changelog	2023-03-01 22:49:39.000000000 +0000
+++ logcheck-1.4.2+deb12u1/debian/changelog	2025-05-04 16:43:20.000000000 +0000
@@ -1,3 +1,16 @@
+logcheck (1.4.2+deb12u1) bookworm; urgency=medium
+
+  [ Mathias Gibbens ]
+  * Update d/gbp.conf for debian/bookworm branch
+
+  [ Richard Lewis ]
+  * Ensure that if a user deleted /etc/logcheck/header.txt before
+    upgrading to bookworm then the file stays deleted (Closes: #1049412).
+    NB that the best way to suppress the header is to set INTRO=0 in
+    /etc/logcheck/logcheck.conf
+
+ -- Mathias Gibbens <gib...@debian.org>  Sun, 04 May 2025 16:43:20 +0000
+
 logcheck (1.4.2) unstable; urgency=medium
 
   * More explicitly mention the default checking of the systemd journal
diff -Nru logcheck-1.4.2/debian/gbp.conf logcheck-1.4.2+deb12u1/debian/gbp.conf
--- logcheck-1.4.2/debian/gbp.conf	2023-03-01 22:49:39.000000000 +0000
+++ logcheck-1.4.2+deb12u1/debian/gbp.conf	2025-05-04 16:43:20.000000000 +0000
@@ -1,8 +1,8 @@
 [DEFAULT]
+debian-branch = debian/bookworm
+dist = DEP14
 
 [buildpackage]
-#pbuilder = true
-#export-dir = ../build-area
 sign-tags = true
 
 [import-orig]
diff -Nru logcheck-1.4.2/debian/logcheck.postinst logcheck-1.4.2+deb12u1/debian/logcheck.postinst
--- logcheck-1.4.2/debian/logcheck.postinst	2023-03-01 22:49:39.000000000 +0000
+++ logcheck-1.4.2+deb12u1/debian/logcheck.postinst	2025-05-04 16:43:20.000000000 +0000
@@ -66,6 +66,14 @@
 				chown logcheck:logcheck "$f" || true
 				chmod u=rwx,g=rx,o= "$f" || true   # drwxr-x---
 		done
+
+	# remove once trixie is stable (see also preinst)
+	if [ -f /etc/logcheck/header.txt.was-deleted-before-bookworm ]; then
+		echo "Preserving user-deletion of /etc/logcheck/header.txt -- packaged version is left at /etc/logcheck/header.txt.dpkg-new"
+		mv -f /etc/logcheck/header.txt /etc/logcheck/header.txt.dpkg-new || true
+		rm -f /etc/logcheck/header.txt.was-deleted-before-bookworm || true
+	fi
+
   ;;
 
   abort-upgrade|abort-remove|abort-deconfigure)
diff -Nru logcheck-1.4.2/debian/logcheck.preinst logcheck-1.4.2+deb12u1/debian/logcheck.preinst
--- logcheck-1.4.2/debian/logcheck.preinst	1970-01-01 00:00:00.000000000 +0000
+++ logcheck-1.4.2+deb12u1/debian/logcheck.preinst	2025-05-04 16:43:20.000000000 +0000
@@ -0,0 +1,10 @@
+#!/bin/sh
+set -e
+
+# preserve deletion of /etc/logcheck/header.txt if upgrading from <= 1.4.1 --- see #1049412
+if [ "$1" = "upgrade" ] && [ ! -f /etc/logcheck/header.txt ] && dpkg --compare-versions "$2" le-nl 1.4.1; then
+	echo "You deleted /etc/logcheck/header.txt before bookworm: this deletion will be preserved. However, it would be better to set INTRO=0 in /etc/logcheck.conf instead."
+	touch /etc/logcheck/header.txt.was-deleted-before-bookworm || :
+fi
+
+#DEBHELPER#

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to