]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
etcupdate: Gracefully handle SIGINT when building trees.
authorJohn Baldwin <jhb@FreeBSD.org>
Tue, 20 Apr 2021 20:22:11 +0000 (13:22 -0700)
committerJohn Baldwin <jhb@FreeBSD.org>
Wed, 9 Jun 2021 21:19:19 +0000 (14:19 -0700)
commit29ed8efb3b1e834a5c6f4726fa2516a5af3266a9
tree9c1d2666682bd50e09eac6be4c19f0d5eef8bb17
parent6914b924d57989b1da56588c247b9e248a9190ff
etcupdate: Gracefully handle SIGINT when building trees.

Run the 'build_tree' function inside of a subshell and trap SIGINT to
return an error to the caller.  This allows callers to gracefully
cleanup a partially created tree.

While here, redirect stdout/stderr of the subshell to the log file
instead of applying redirections individually to each command executed
while building the tree.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D29844

(cherry picked from commit 1f7afa9364805a912270c9d6a70dc4a889d47a4e)
usr.sbin/etcupdate/etcupdate.sh