find-debuginfo.sh: Exit with real exit status in parallel jobs
authorKeith Seitz <keiths@redhat.com>
Fri, 16 Aug 2024 18:54:20 +0000 (11:54 -0700)
committerMark Wielaard <mark@klomp.org>
Tue, 20 Aug 2024 14:47:19 +0000 (16:47 +0200)
commitdfe1f7ff30f4e0be538835fca1e6348723ea7aa7
treece0a74528d54a33772dbdbbb4b2a86803ce181a6
parent630644cd7ce3ee068f5c105ad42adaa5a6f21287
find-debuginfo.sh: Exit with real exit status in parallel jobs

Currently, when the script is executed in parallel (-jN), the
resulting exit status will always be 0.

The script execs an appropriate number of clones of itself, calling
run_job to run the actual workload. This then calls do_file(), saving
the exit status into "res.$jobid".

In do_file(), though, if an error occurs, exit is called. This causes
the entire exec'd shell to exit with status 0 (since there are almost
always echo calls as the last executed statement). The real exit
status is therefor never written to the "res.$jobid" files by run_job().

The simple solution is to use 'return' instead of 'exit'. A number
of minor adjustments are also made to propagate this properly so that
it is reported as the correct exit status.

While at it, I've incorporated a patch for find-debuginfo/30505.
Using this patch and another patch to the RPM package (submitted as
github issue #3215), failures of gdb-add-index.sh will now properly fail
the build instead of being swallowed. It should be much easier for
developers to figure out why their builds have failed should gdb crash.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30505
Signed-off-by: Keith Seitz <keiths@redhat.com>
scripts/find-debuginfo.in
This page took 0.059106 seconds and 5 git commands to generate.