fix(debconf): handle missing template field better

This commit is contained in:
tcely
2026-09-12 22:25:06 -04:00
parent c4f2913812
commit 2856ae1065
2 changed files with 15 additions and 0 deletions

View File

@@ -66,6 +66,7 @@ ENV DEBIAN_FRONTEND="noninteractive" \
PIP_ROOT_USER_ACTION='ignore'
COPY --from=tubesync-etc /etc/debconf.conf /etc/debconf.conf
COPY --from=tubesync-etc /usr/share/perl5/Debconf/DbDriver/Copy.pm /usr/share/perl5/Debconf/DbDriver/Copy.pm
COPY --from=tubesync-etc /usr/share/perl5/Debconf/DbDriver/PackageDir.pm /usr/share/perl5/Debconf/DbDriver/PackageDir.pm
RUN --mount=type=cache,id=apt-lib-cache-${TARGETARCH},sharing=private,target=/var/lib/apt \

View File

@@ -0,0 +1,14 @@
--- /usr/share/perl5/Debconf/DbDriver/Copy.pm.orig 2025-03-10 12:07:15.000000000 +0000
+++ /usr/share/perl5/Debconf/DbDriver/Copy.pm 2026-09-13 02:07:03.178411588 +0000
@@ -22,7 +22,10 @@
@owners=("unknown");
}
foreach my $owner (@owners) {
- my $template = Debconf::Template->get($src->getfield($item, 'template'));
+ my $template_name = $src->getfield($item, 'template');
+ my $template = (defined($template_name) && length($template_name))
+ ? Debconf::Template->get($template_name)
+ : undef;
my $type="";
$type = $template->type if $template;
$dest->addowner($item, $owner, $type);