Description of problem: generate-pgpass.sh is a file that's intended to be sourced by other scripts. It sources engine-prolog.sh, using a path relative to $0. This breaks when the scripts sourcing generate-pgpass.sh are in different directories, because $0 is the path of these scripts, not of generate-pgpass.sh. 4.1 is not affected directly, because only a single file sources generate-pgpass.sh there. But we want to source it from other scripts during the upgrade to 4.2, where generate-pgpass.sh is still in 4.1 (before the upgrade), thus we want to fix this bug for 4.1. In 4.2 it's already fixed by: https://gerrit.ovirt.org/82641
The patch referenced in comment 0 also renames the 'cleanup' function, intending to prevent future collisions with such functions in scripts using it. Not sure this is enough, because 'trap' will only run the last argument. Still thinking whether all of this is the right approach, not sure.
(In reply to Yedidyah Bar David from comment #1) > The patch referenced in comment 0 also renames the 'cleanup' function, > intending to prevent future collisions with such functions in scripts using > it. Not sure this is enough, because 'trap' will only run the last argument. > Still thinking whether all of this is the right approach, not sure. There is also comment in the generate-pgpass.sh that if some script is including generate-pgpass.sh and reusing trap, they should include calling of pgPassCleanup into their own trap function. AFAIK you cannot register multiple function within the trap call, so do you think there is some better way how to handle that?
ok, ovirt-engine-tools-4.1.7.4-0.1.el7.noarch - clean install successful - upgrade with vacuum successful