public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/fedora-review] rawhide: Fix crash on RPMs containing no files
@ 2026-07-18 12:03 
  0 siblings, 0 replies; only message in thread
From:  @ 2026-07-18 12:03 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/fedora-review
            Branch : rawhide
            Commit : 10403eb648e2babb47cc4c561b1ef71c68a6f363
            Author : Ondrej Mosnáček <omosnacek@gmail.com>
            Date   : 2026-07-16T10:20:39+02:00
            Stats  : +50/-1 in 2 file(s)
            URL    : https://src.fedoraproject.org/rpms/fedora-review/c/10403eb648e2babb47cc4c561b1ef71c68a6f363?branch=rawhide

            Log:
            Fix crash on RPMs containing no files

I'm being affected by this bug, so I'd like to have it fixed in the
Fedora package.

Signed-off-by: Ondrej Mosnáček <omosnacek@gmail.com>

---
diff --git a/001-fix-emtpy-rpms.patch b/001-fix-emtpy-rpms.patch
new file mode 100644
index 0000000..3986465
--- /dev/null
+++ b/001-fix-emtpy-rpms.patch
@@ -0,0 +1,44 @@
+From 59fcbea176197a03206cc43f439da96e9507d912 Mon Sep 17 00:00:00 2001
+From: Peter Lemenkov <lemenkov@gmail.com>
+Date: Thu, 19 Mar 2026 16:37:45 +0100
+Subject: [PATCH] [PATCH] Fix crash on RPMs containing no files
+
+When `rpm -ql --dump` is run against a package with no files, it outputs
+`"(contains no files)"` instead of the expected dump format. The regex
+search returns None, and calling `.start()` on None raises
+`AttributeError`.
+
+The existing except clause only catches `ValueError`, so the
+`AttributeError` propagates up and crashes fedora-review.
+
+Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
+Assisted-by: Claude (Anthropic) <https://claude.ai>
+---
+ src/FedoraReview/deps.py | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/FedoraReview/deps.py b/src/FedoraReview/deps.py
+index 1cf6033..0328f27 100644
+--- a/src/FedoraReview/deps.py
++++ b/src/FedoraReview/deps.py
+@@ -227,7 +227,7 @@ def list_dirs(pkg_filename):
+             first_number_start = first_number_match.start()
+             path = line[:first_number_start].strip()
+             mode = line[first_number_start:].rsplit(None, 10)[3:4][0]
+-        except ValueError:
++        except (ValueError, AttributeError):
+             # E. g., when given '(contains no files)'
+             continue
+         mode = int(mode, 8)
+@@ -349,7 +349,7 @@ def listpaths(pkg_filename):
+             first_number_start = first_number_match.start()
+             path = line[:first_number_start].strip()
+             mode = line[first_number_start:].rsplit(None, 10)[3:4][0]
+-        except ValueError:
++        except (ValueError, AttributeError):
+             # E. g., when given '(contains no files)'
+             continue
+         mode = int(mode, 8)
+-- 
+2.54.0
+

diff --git a/fedora-review.spec b/fedora-review.spec
index a900c9f..4d93eae 100644
--- a/fedora-review.spec
+++ b/fedora-review.spec
@@ -14,13 +14,15 @@
 
 Name:       fedora-review
 Version:    0.11.0
-Release:    5%{?build_nr}%{?git_tag}%{?dist}
+Release:    6%{?build_nr}%{?git_tag}%{?dist}
 Summary:    Review tool for fedora rpm packages
 
 License:    GPL-2.0-or-later
 URL:        https://pagure.io/FedoraReview
 Source0:    https://releases.pagure.org/FedoraReview/fedora_review-%{version}%{?git_tag}.tar.gz
 
+Patch:      https://forge.fedoraproject.org/packaging/FedoraReview/pulls/546.patch#/001-fix-emtpy-rpms.patch
+
 BuildArch:  noarch
 
 BuildRequires:  mock >= 3.0
@@ -154,6 +156,9 @@ mock --quiet -r fedora-38-x86_64 --uniqueext=hugo --init
 
 
 %changelog
+* Thu Jul 16 2026 Ondrej Mosnáček <omosnacek@gmail.com> - 0.11.0-6
+- Fix crash on RPMs containing no files
+
 * Wed Jul 15 2026 Fedora Release Engineering <releng@fedoraproject.org> - 0.11.0-5
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild
 

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-07-18 12:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-18 12:03 [rpms/fedora-review] rawhide: Fix crash on RPMs containing no files 

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox