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

> [root@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/c2082634...@github.com>
_______________________________________________
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint

Reply via email to