This is an automated email from the git hooks/post-receive script.

guillem pushed a commit to branch main
in repository dpkg.

View the commit online:
https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=a0c80e58a85983d57f03ed199e0c9fda15a2a8b0

commit a0c80e58a85983d57f03ed199e0c9fda15a2a8b0
Author: Guillem Jover <[email protected]>
AuthorDate: Fri Aug 29 12:30:20 2025 +0200

    Dpkg::Shlibs::SymbolFile: Rename file option to filename
    
    This matches the same option name used in most other function and methods
    in the codebase, when we need to pass a filename. This avoids the
    potential confusion of this being a file object or a handle.
    
    No backwards compatibility code, because this is a private module.
---
 scripts/Dpkg/Shlibs/SymbolFile.pm |  6 +++---
 scripts/dpkg-gensymbols.pl        |  8 ++++----
 scripts/dpkg-shlibdeps.pl         |  2 +-
 scripts/t/Dpkg_Shlibs.t           | 38 +++++++++++++++++++-------------------
 4 files changed, 27 insertions(+), 27 deletions(-)

diff --git a/scripts/Dpkg/Shlibs/SymbolFile.pm 
b/scripts/Dpkg/Shlibs/SymbolFile.pm
index 4b82ba1ac..5d04d67a1 100644
--- a/scripts/Dpkg/Shlibs/SymbolFile.pm
+++ b/scripts/Dpkg/Shlibs/SymbolFile.pm
@@ -105,8 +105,8 @@ sub new {
     bless $self, $class;
     $self->{arch} //= get_host_arch();
     $self->clear();
-    if (exists $self->{file}) {
-       $self->load($self->{file}) if -e $self->{file};
+    if (exists $self->{filename}) {
+        $self->load($self->{filename}) if -e $self->{filename};
     }
     return $self;
 }
@@ -218,7 +218,7 @@ sub parse {
     if (exists $state->{seen}) {
        return if exists $state->{seen}{$file}; # Avoid include loops
     } else {
-       $self->{file} = $file;
+        $self->{filename} = $file;
         $state->{seen} = {};
     }
     $state->{seen}{$file} = 1;
diff --git a/scripts/dpkg-gensymbols.pl b/scripts/dpkg-gensymbols.pl
index f667a2edd..09a86deba 100755
--- a/scripts/dpkg-gensymbols.pl
+++ b/scripts/dpkg-gensymbols.pl
@@ -316,8 +316,8 @@ unless ($quiet) {
     my $after = File::Temp->new(
         TEMPLATE => 'dpkg-gensymbolsXXXXXX',
     );
-    if ($ref_symfile->{file}) {
-        $file_label = $ref_symfile->{file};
+    if ($ref_symfile->{filename}) {
+        $file_label = $ref_symfile->{filename};
     } else {
         $file_label = 'new_symbol_file';
     }
@@ -337,9 +337,9 @@ unless ($quiet) {
     if (File::Compare::compare($before, $after) != 0) {
        if (not defined($output)) {
            warning(g_('the generated symbols file is empty'));
-       } elsif (defined($ref_symfile->{file})) {
+        } elsif (defined($ref_symfile->{filename})) {
            warning(g_("%s doesn't match completely %s"),
-                   $output, $ref_symfile->{file});
+                    $output, $ref_symfile->{filename});
        } else {
            warning(g_('no debian/symbols file used as basis for generating 
%s'),
                    $output);
diff --git a/scripts/dpkg-shlibdeps.pl b/scripts/dpkg-shlibdeps.pl
index 0b32d5b2e..510bd1edc 100755
--- a/scripts/dpkg-shlibdeps.pl
+++ b/scripts/dpkg-shlibdeps.pl
@@ -325,7 +325,7 @@ foreach my $file (keys %exec) {
                     debug(1, "Using symbols file $symfile_path for $soname");
                     $symfile_cache{$symfile_path} //=
                         Dpkg::Shlibs::SymbolFile->new(
-                            file => $symfile_path,
+                            filename => $symfile_path,
                         );
                     
$symfile->merge_object_from_symfile($symfile_cache{$symfile_path}, $soname);
                 }
diff --git a/scripts/t/Dpkg_Shlibs.t b/scripts/t/Dpkg_Shlibs.t
index 7bd68f430..273478fee 100644
--- a/scripts/t/Dpkg_Shlibs.t
+++ b/scripts/t/Dpkg_Shlibs.t
@@ -174,13 +174,13 @@ use_ok('Dpkg::Shlibs::SymbolFile');
 use_ok('Dpkg::Shlibs::Symbol');
 
 my $sym_file = Dpkg::Shlibs::SymbolFile->new(
-    file => "$datadir/symbol_file.tmp",
+    filename => "$datadir/symbol_file.tmp",
 );
 my $sym_file_dup = Dpkg::Shlibs::SymbolFile->new(
-    file => "$datadir/symbol_file.tmp",
+    filename => "$datadir/symbol_file.tmp",
 );
 my $sym_file_old = Dpkg::Shlibs::SymbolFile->new(
-    file => "$datadir/symbol_file.tmp",
+    filename => "$datadir/symbol_file.tmp",
 );
 
 my $obj_old = load_objdump_obj('libc6-2.3');
@@ -247,16 +247,16 @@ sub save_load_test {
     my $save_file = File::Temp->new();
     $symfile->save($save_file->filename, @opts);
     my $dup = Dpkg::Shlibs::SymbolFile->new(
-        file => $save_file->filename,
+        filename => $save_file->filename,
     );
     # Force sync of non-stored attributes
-    $dup->{file} = $symfile->{file};
+    $dup->{filename} = $symfile->{filename};
     $dup->{arch} = $symfile->{arch};
 
     is_deeply($dup, $symfile, $comment);
-    if (-f $symfile->{file}) {
-       is(system('diff', '-u', $symfile->{file}, $save_file->filename), 0,
-           basename($symfile->{file}) . ' dumped identical');
+    if (-f $symfile->{filename}) {
+        is(system('diff', '-u', $symfile->{filename}, $save_file->filename), 0,
+            basename($symfile->{filename}) . ' dumped identical');
     }
 }
 
@@ -268,7 +268,7 @@ $obj = load_objdump_obj('internal');
 
 # Do not ignore any internal symbols
 $sym_file = Dpkg::Shlibs::SymbolFile->new(
-    file => "$datadir/symbols.internal-filter",
+    filename => "$datadir/symbols.internal-filter",
 );
 $sym_file->merge_symbols($obj, '100.MISSING');
 
@@ -294,7 +294,7 @@ is($sym, undef, 'unknown aeabi symbol omitted while 
filtering internal symbols')
 
 # Include internal symbols using the allow-internal tag.
 $sym_file = Dpkg::Shlibs::SymbolFile->new(
-    file => "$datadir/symbols.internal-allow",
+    filename => "$datadir/symbols.internal-allow",
 );
 $sym_file->merge_symbols($obj, '100.MISSING');
 
@@ -362,7 +362,7 @@ is_deeply($sym,
 
 # Include internal symbols using the Allow-Internal-Symbol-Groups field
 $sym_file = Dpkg::Shlibs::SymbolFile->new(
-    file => "$datadir/symbols.internal-allow-groups",
+    filename => "$datadir/symbols.internal-allow-groups",
 );
 $sym_file->merge_symbols($obj, '100.MISSING');
 
@@ -413,7 +413,7 @@ is_deeply($sym,
 
 # Test include mechanism of SymbolFile
 $sym_file = Dpkg::Shlibs::SymbolFile->new(
-    file => "$datadir/symbols.include-1",
+    filename => "$datadir/symbols.include-1",
 );
 
 $sym = $sym_file->lookup_symbol('symbol_before@Base', 'libfake.so.1');
@@ -475,7 +475,7 @@ is_deeply($sym,
 );
 
 $sym_file = Dpkg::Shlibs::SymbolFile->new(
-    file => "$datadir/symbols.include-2",
+    filename => "$datadir/symbols.include-2",
 );
 
 $sym = $sym_file->lookup_symbol('symbol1_fake2@Base', 'libfake.so.1');
@@ -586,7 +586,7 @@ check_spacesym('symshortverSPA CEprotected', 'V1', 
'protected');
 # Parsing/dumping
 # Template mode
 $sym_file = Dpkg::Shlibs::SymbolFile->new(
-    file => "$datadir/basictags.symbols",
+    filename => "$datadir/basictags.symbols",
     arch => 'amd64',
 );
 save_load_test($sym_file, 'template save -> load',
@@ -610,7 +610,7 @@ is($io_data,
 # Dumping in non-template mode (mips) (test for arch tags)
 open $io, '>', \$io_data or die "cannot open io string\n";
 $sym_file = Dpkg::Shlibs::SymbolFile->new(
-    file => "$datadir/basictags.symbols",
+    filename => "$datadir/basictags.symbols",
     arch => 'mips',
 );
 $sym_file->output($io);
@@ -629,11 +629,11 @@ is($io_data,
 # Dumping in non-template mode (i386) (test for arch tags)
 open $io, '>', \$io_data or die "cannot open io string\n";
 $sym_file = Dpkg::Shlibs::SymbolFile->new(
-    file => "$datadir/basictags.symbols",
+    filename => "$datadir/basictags.symbols",
     arch => 'i386',
 );
 $sym_file_dup = Dpkg::Shlibs::SymbolFile->new(
-    file => "$datadir/basictags.symbols",
+    filename => "$datadir/basictags.symbols",
     arch => 'i386',
 );
 $sym_file->output($io);
@@ -863,7 +863,7 @@ is_deeply(\@tmp,
 
 # Tests for tagged #includes
 $sym_file = Dpkg::Shlibs::SymbolFile->new(
-    file => "$datadir/symbols.include-3",
+    filename => "$datadir/symbols.include-3",
     arch => 'i386',
 );
 $sym = $sym_file->lookup_symbol('symbol2_fake1@Base', 'libbasictags.so.2');
@@ -946,7 +946,7 @@ sub load_patterns_obj {
 
 sub load_patterns_symbols {
     $sym_file = Dpkg::Shlibs::SymbolFile->new(
-        file => "$datadir/patterns.symbols",
+        filename => "$datadir/patterns.symbols",
     );
     return $sym_file;
 }

-- 
Dpkg.Org's dpkg

Reply via email to