#534 CheckSpecAsInSRPM using Source0 instead of SRPM filename in compare
Opened by kgiusti. Modified

When I run fedora-review on my SRPM fedora-review is flagging the CheckSpecAsInSRPM test as failing. See the review updates to https://bugzilla.redhat.com/show_bug.cgi?id=2400470

Looking further into the failure it appears as if the check in generic_should.py ends up comparing the spec filename against the filename of the Source0 tar file, not the SRPM itself.

See the debug code I've added to fedora-review here: https://pagure.io/fork/kgiusti/FedoraReview/blob/filename-issue/f/plugins/generic_should.py#_667

In that fork you'll also find my SRPM in the tmp subdirectory.

When I run that instrumented code against the SRPM I get the following output:

KAG - RUNNING CHECK SPEC AS IN SRPM=
KAG - pattern=/home/kgiusti/tmp/FedoraReview/go-fdo-server/srpm-unpacked/.spec
KAG - srpm_spec_file=/home/kgiusti/tmp/FedoraReview/go-fdo-server/srpm-unpacked/go-fdo-server.spec
KAG - self.srpm.filename=go-fdo-server-a2d258a47464017cea850bfd60d2439656374543.tar.gz*
KAG - basename(self.srpm.filename)=go-fdo-server-a2d258a47464017cea850bfd60d2439656374543.tar.gz
KAG - split basename(self.srpm.filename)=['go-fdo', 'server', 'a2d258a47464017cea850bfd60d2439656374543.tar.gz']
KAG spec=/home/kgiusti/tmp/FedoraReview/go-fdo-server/srpm-unpacked/go-fdo-server.spec pkg_name=go-fdo
KAG 'go-fdo-server.spec' vs 'go-fdo.spec' UNEXPECTED!

For some reason the path to the SRPM file is incorrect - that is the path to the Source0 tar file.
Note when I run the test in isolation using --single CheckSpecAsInSRPM the error does not occur.

To reproduce in my fork:
./try-fedora-review --single CheckSpecAsInSRPM --rpm-spec -n tmp/go-fdo-server-0-0.1.20251021gita2d258a.fc44.src.rpm


Metadata