🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.debian.bugs.dist
Article #6209

Bug#1069907: dh_apache2: please output reproducible module package pre/post scripts.

#6209
From: James McCoy
Date: Wed, 25 Nov 2026 21:40
99 lines
5521 bytes
--ie7qyoydzzrw3mmu
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Disposition: inline

Control: tag -1 patch

On Tue, Nov 24, 2026 at 03:01:33PM -0800, Vagrant Cascadian wrote:
>This seems to match debian/debhelper/postinst-apache2:
>
>if #CONDITIONAL_VARIABLE#; then
>    if [ -e /usr/share/apache2/apache2-maintscript-helper ] ; then
>        . /usr/share/apache2/apache2-maintscript-helper
>        for conf in #NAMES# ; do
>            apache2_invoke #HELPER# $conf #ACTION# || #ERROR_HANDLER#
>        done
>    fi
>fi
>
>Which is apparently set in debian/debhelper/dh_apache2.in:
>
>                my %replacements = (
>                    HELPER => $ref->[0],
>                    NAMES  => $ref->[1],
>                    ERROR_HANDLER => $PACKAGE_TYPE{handler},
>                    CONDITIONAL_VARIABLE => $PACKAGE_TYPE{conditional},
>                    ACTION => $dh{RESTART},
>                );
>
>                if ($script_type eq "prerm" || $script_type eq "postrm")
>                {
>                    $replacements{'HELPER'} =~ s/en/dis/;
>                }
>
>                my $sed_command = "";
>                foreach my $key (sort keys %replacements)
>                {
>                    my $val = $replacements{$key};
>                    # Use a control char as separator for sed, to
>                    # reduce escaping issues. Everything else is
>                    # passed verbatim, i.e. it must not contain any
>                    # shell or sed special characters.
>                    my $sep = "\x17";
>                    $sed_command .= "s" . $sep . "#$key#" .
>
>It appears to call sort, but perhaps it is sorting the wrong things, or
>at the wrong timing?

This isn't the relevant part, I believe. Neither subversion nor mod-mono
use a .apache2 file to declare the module information. They rely on
dh_apache2's auto-discovery.

The attached patch should make this process reproducible.

Cheers,
-- 
James (he/him)
GPG Key: 4096R/91BF BF4D 6956 BD5D F7B7  2D23 DFE6 91AE 331B A3DB

--ie7qyoydzzrw3mmu
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="0001-dh_apache2-Sort-File-Find-results.patch"

From 979654bae43fe845e6a748543a4b5059b0a80409 Mon Sep 17 00:00:00 2001
From: James McCoy <jamessan@debian.org>
Date: Mon, 23 Nov 2026 22:12:26 -0500
Subject: [PATCH] dh_apache2: Sort File::Find results

When no .apache2 file is present, the has_a_* arrays are populated by
using File::Find::find() to gather relevant files and pushing the
garnered data into the has_a_* arrays. Since the order the files are fed
to find() can vary, this produces non-reproducible results.

Use find()'s preprocess key to sort the files first.

Closes: #1069907
Signed-off-by: James McCoy <jamessan@debian.org>
---
 debian/debhelper/dh_apache2.in | 1 +
 1 file changed, 1 insertion(+)

diff --git a/debian/debhelper/dh_apache2.in b/debian/debhelper/dh_apache2.in
index 862d2f85..8e5dbaf6 100755
--- a/debian/debhelper/dh_apache2.in
+++ b/debian/debhelper/dh_apache2.in
@@ -462,6 +462,7 @@ foreach my $package ((@{$dh{DOPACKAGES}}))
 	{
 		# do black magic only if there is no .apache2 configuration file
 		find({  no_chdir => 1,
+			preprocess => sub { sort },
 			wanted => sub
 			{
 				my ($dir, $file) = (dirname($File::Find::name), basename($File::Find::name));
-- 
2.53.0


--ie7qyoydzzrw3mmu--
Technical Details
Message-ID: <O3sSC-e8Tb-17@gated-at.bofh.it>
Path: mbox-mo1.pugleaf.net!news-lon.pugleaf.net!news.tcpreset.net!newsfeed.bofh.team!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomod
References: <IxBiN-9c5j-1@gated-at.bofh.it> <IxBiN-9c5j-1@gated-at.bofh.it> <O37O9-dXH2-7@gated-at.bofh.it> <IxBiN-9c5j-1@gated-at.bofh.it> <O37O9-dXH2-7@gated-at.bofh.it>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lon.pugleaf.net!news.tcpreset.net!newsfeed.bofh.team!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomod
From: James McCoy <jamessan@debian.org>
Newsgroups: linux.debian.bugs.dist
Subject: Bug#1069907: dh_apache2: please output reproducible module package pre/post scripts.
Date: Wed, 25 Nov 2026 22:40:02 +0100
Message-ID: <O3sSC-e8Tb-17@gated-at.bofh.it>
References: <IxBiN-9c5j-1@gated-at.bofh.it> <IxBiN-9c5j-1@gated-at.bofh.it> <O37O9-dXH2-7@gated-at.bofh.it> <IxBiN-9c5j-1@gated-at.bofh.it> <O37O9-dXH2-7@gated-at.bofh.it>
X-Original-To: Vagrant Cascadian <vagrant@reproducible-builds.org>, 
	1069907@bugs.debian.org
X-Mailbox-Line: From debian-bugs-dist-request@lists.debian.org  Wed Nov 25 21:35:07 2026
Old-Return-Path: <debbugs@buxtehude.debian.org>
X-Spam-Flag: NO
X-Spam-Score: -1.7
Reply-To: James McCoy <jamessan@debian.org>, 1069907@bugs.debian.org
Resent-To: debian-bugs-dist@lists.debian.org
Resent-Cc: debian-apache@lists.debian.org
X-Debian-Pr-Message: followup 1069907
X-Debian-Pr-Package: apache2-dev
X-Debian-Pr-Source: apache2
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="ie7qyoydzzrw3mmu"
Content-Disposition: inline
X-Debian-User: jamessan
X-Debian-Message: from BTS
X-Mailing-List: <debian-bugs-dist@lists.debian.org> archive/latest/2005069
List-ID: <debian-bugs-dist.lists.debian.org>
List-URL: <https://lists.debian.org/debian-bugs-dist/>
Approved: robomod@news.nic.it
Lines: 99
Organization: linux.* mail to news gateway
Sender: robomod@news.nic.it
X-Original-Cc: James Addison <jay@jp-hosting.net>
X-Original-Date: Wed, 25 Nov 2026 16:33:03 -0500
X-Original-Message-ID: <awdTa5-kOvd2eMCq@localhost>
X-Original-References: <171416628730.3394.11446425578811945454.reportbug@frontier> <171416628730.3394.11446425578811945454.reportbug@frontier> <87wlq1u94i.fsf@wireframe> <171416628730.3394.11446425578811945454.reportbug@frontier> <87wlq1u94i.fsf@wireframe>