[Rpm-maint] [rpm-software-management/rpm] Add error messages for url helper calls (PR #3041)

Panu Matilainen notifications at github.com
Mon Apr 29 12:45:18 UTC 2024


Hmm, and of course we have entirely different way of reporting the error on install, eg:

> [root at localhost _build]# ./tools/rpm --define "_urlhelper /bad" -U --nodeps --root /srv/test https://ftp.funet.fi/pub/mirrors/fedora.redhat.com/pub/fedora/linux/development/rawhide/Everything/x86_64/os/Packages/0/0xFFFF-0.10-7.fc40.x86_64.rpm
error: Could not find url helper: "/bad": No such file or directory
error: skipping https://ftp.funet.fi/pub/mirrors/fedora.redhat.com/pub/fedora/linux/development/rawhide/Everything/x86_64/os/Packages/0/0xFFFF-0.10-7.fc40.x86_64.rpm - transfer failed

Which isn't so bad. But probably --import and all have their own more cryptic variants like the query above. Anyway, if we accept that we call rpmlog() from that location, it is an improvement for the user. Which is what matters in the end I guess.

Besides tests there are some improvements you can make here:
The exec() can fail for other reasons besides not found, so I'd use a more generic error message there. Maybe just "failed to execute url helper". The exact error code is available in the child if we move the log there (ignoring the wrath of rpmlog after fork), or we could extend our use of the bash scheme started in faaa0305f5. From bash(1): "If a command is not found, the child process created to execute it returns a status of  127.   If  a  command  is found but is not executable, the return status is 126."

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

Message ID: <rpm-software-management/rpm/pull/3041/c2082634102 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20240429/6c2638b5/attachment-0001.html>


More information about the Rpm-maint mailing list