Package: aptitude-common
Version: 0.8.13-8
Severity: normal
Tags: patch

Hi!

Starting with dpkg 1.23.0, the "file" option is deprecated and
emits a warning to that effect, which is replaced by the "filename"
option.

To ease in the migration and to avoid making code not backportable,
the deprecated option is accepted with no warning if the new option is
passed as well, so that both old and new dpkg modules can be used.
Only after 1.24.0, the old option will be obsoleted and unconditionally
start generating warnings or errors.

Attached a patch that fixes and implements the above.

Thanks,
Guillem
From e2df8d80b2a6edd49ce6dda6aedffa08c0b8ef93 Mon Sep 17 00:00:00 2001
From: Guillem Jover <[email protected]>
Date: Fri, 19 Dec 2025 22:50:18 +0100
Subject: [PATCH] aptitude-changelog-parser: Pass also filename to
 Dpkg::Changelog::Parse

Starting with dpkg 1.23.0, the "file" option is deprecated and
emits a warning to that effect, which is replaced by the "filename"
option.

To ease in the migration and to avoid making code not backportable,
the deprecated option is accepted with no warning if the new option is
passed as well, so that both old and new dpkg modules can be used.
Only after 1.24.0, the old option will be obsoleted and unconditionally
start generating warnings or errors.
---
 aptitude-changelog-parser | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/aptitude-changelog-parser b/aptitude-changelog-parser
index 9a71ca6a..762f3308 100755
--- a/aptitude-changelog-parser
+++ b/aptitude-changelog-parser
@@ -16,7 +16,9 @@ eval {
 
 my %opts;
 if (scalar @ARGV >= 1) {
-    $opts{file} = shift @ARGV;
+    $opts{filename} = shift @ARGV;
+    # Set file for backwards compatibility with dpkg < 1.23.0.
+    $opts{file} = $opts{filename};
 }
 if (scalar @ARGV == 1) {
     $opts{from} = $ARGV[0];
-- 
2.51.0

Reply via email to