From e7898a00cd241029175b89df0921dc6cb7705384 Mon Sep 17 00:00:00 2001 From: lipengyu Date: Sat, 1 Nov 2025 00:21:28 +0800 Subject: [PATCH] fix uninitialized value warning message --- ...-uninitialized-value-warning-message.patch | 24 +++++++++++++++++++ perl-File-MimeInfo.spec | 8 +++++-- 2 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 backport-fix-uninitialized-value-warning-message.patch diff --git a/backport-fix-uninitialized-value-warning-message.patch b/backport-fix-uninitialized-value-warning-message.patch new file mode 100644 index 0000000..13fdea4 --- /dev/null +++ b/backport-fix-uninitialized-value-warning-message.patch @@ -0,0 +1,24 @@ +From f0376e9a142be9d160fb13dfb689cd2e3c874251 Mon Sep 17 00:00:00 2001 +From: zhumengu +Date: Sat, 18 Oct 2025 21:41:12 +0800 +Subject: [PATCH] Empty list check, fix uninitialized value warning message + +When a null value is passed to File::BaseDir, the `catfile` function issues a warning. + +`Use of uninitialized value in subroutine entry at /usr/share/perl5/vendor_perl/File/BaseDir.pm line 107.` +--- + lib/File/MimeInfo/Applications.pm | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/lib/File/MimeInfo/Applications.pm b/lib/File/MimeInfo/Applications.pm +index 442a97e..43d7c51 100644 +--- a/lib/File/MimeInfo/Applications.pm ++++ b/lib/File/MimeInfo/Applications.pm +@@ -103,6 +103,7 @@ sub _default { + $Carp::CarpLevel++; + my @paths = grep defined, ($mimetype, $user, $system, $deprecated, $distro, $legacy); + my @list = _read_list(@paths); ++ return undef if @list == 0; + my $desktop_file = _find_file(reverse @list); + $Carp::CarpLevel--; + diff --git a/perl-File-MimeInfo.spec b/perl-File-MimeInfo.spec index 37b1e2d..46b7f46 100644 --- a/perl-File-MimeInfo.spec +++ b/perl-File-MimeInfo.spec @@ -2,12 +2,13 @@ Name: perl-File-MimeInfo Version: 0.35 -Release: 3 +Release: 4 Summary: Implement the freedesktop specification License: GPL-1.0-or-later or Artistic-1.0 URL: https://metacpan.org/release/File-MimeInfo Source0: https://cpan.metacpan.org/modules/by-module/File/File-MimeInfo-%{version}.tar.gz +Patch0: backport-fix-uninitialized-value-warning-message.patch BuildArch: noarch BuildRequires: findutils make @@ -36,7 +37,7 @@ Summary: Help documents for perl-File-MimeInfo The help documents for perl-File-MimeInfo %prep -%setup -q -n File-MimeInfo-%{version} +%autosetup -p1 -n File-MimeInfo-%{version} %build perl Makefile.PL INSTALLDIRS=vendor @@ -59,6 +60,9 @@ make test %{_mandir}/man3/* %changelog +* Mon Nov 10 2025 lipengyu - 0.35-4 +- fix uninitialized value warning message + * Sat Jan 18 2025 Funda Wang - 0.35-3 - drop useless perl(:MODULE_COMPAT) requirement -- Gitee