Control: tag -1 + patch

* gregor herrmann <[email protected]> [2025-08-10 18:21]:
The easiest fix would be to disable the affected test. Please reach out if you need help with that.

I was trying to find out _what_ actually tries to access /var/lib/dpkg/available but didn't manage to do so.

(I guess Dpkg::Index (or AptPkg::Config/AptPkg::Cache) but I'm not sure.)

Finding the root of this problem might be better than just skipping over it …

I had a quick look and the attached patch fixes it for me.

Cheers Jochen
From c8a3af5b8bc10faa0a0e81a0615fd1750fc2f02e Mon Sep 17 00:00:00 2001
From: Jochen Sprickerhof <[email protected]>
Date: Sun, 10 Aug 2025 19:05:58 +0200
Subject: [PATCH] Only load dpkg/available when it exists

Closes: #1107771
---
 lib/DhMakePerl/Command/Packaging.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/DhMakePerl/Command/Packaging.pm b/lib/DhMakePerl/Command/Packaging.pm
index 3eecd83..be5abbe 100644
--- a/lib/DhMakePerl/Command/Packaging.pm
+++ b/lib/DhMakePerl/Command/Packaging.pm
@@ -1402,7 +1402,7 @@ sub discover_dependencies {
         # Don't cache this in case we've built and installed a
         # module in this instance.
         my $dpkg_available = Dpkg::Index->new(type => CTRL_INFO_PKG);
-        $dpkg_available->load("$Dpkg::ADMINDIR/available");
+        $dpkg_available->load("$Dpkg::ADMINDIR/available") if -f "$Dpkg::ADMINDIR/available";
 
         return $self->control->discover_dependencies(
             {   dir                => $self->main_dir,
-- 
2.50.1

Attachment: signature.asc
Description: PGP signature

Reply via email to