[Rpm-maint] [rpm-software-management/rpm] Fix misleading error message on some invalid filetrigger conditions (… (PR #2629)

Panu Matilainen notifications at github.com
Wed Aug 23 10:40:09 UTC 2023


…#2584)

We used to test the first argument in parseScript() and then again in parseRCPOT(), with different error messages in each case as if they were separate issues. Only, the one in parseRCPOT() didn't get a chance to execute because it was caught by checkDep() before it (probably added after the file trigger check was initially added) and so for invalid file trigger conditions (such as an unexpanded macro), you'd get a very misleading error about dependency tokens where an absolute path is expected, and worse, it was reporting an incorrect line and a line number while at it.

Measure twice, cut once doesn't apply here. Check once and be consistent about reporting it. Due to the way triggers are handled, we can't report the line number correctly so don't even try, the wrong line number is far worse than not having it at all. Add some tests to go.

Fixes: #2584
You can view, comment on, or merge this pull request online at:

  https://github.com/rpm-software-management/rpm/pull/2629

-- Commit Summary --

  * Fix misleading error message on some invalid filetrigger conditions (#2584)

-- File Changes --

    M build/parseReqs.c (24)
    M build/parseScript.c (6)
    A tests/data/SPECS/badftrigger.spec (14)
    M tests/rpmbuild.at (28)

-- Patch Links --

https://github.com/rpm-software-management/rpm/pull/2629.patch
https://github.com/rpm-software-management/rpm/pull/2629.diff

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/2629
You are receiving this because you are subscribed to this thread.

Message ID: <rpm-software-management/rpm/pull/2629 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20230823/2f4ffc7d/attachment-0001.html>


More information about the Rpm-maint mailing list