diff options
author | Luke Shumaker <lukeshu@parabola.nu> | 2017-02-06 02:55:30 -0500 |
---|---|---|
committer | Luke Shumaker <lukeshu@parabola.nu> | 2017-02-06 03:10:11 -0500 |
commit | 09bc36a930319d1287c41b78b24acfb36b0a8715 (patch) | |
tree | b5835925ca7e38c9810c26e02f0ec5b29bea41f5 /archbuild.in | |
parent | 76dec8507e2e767db07f967644ed8958f85cd5a2 (diff) | |
download | devtools32-09bc36a930319d1287c41b78b24acfb36b0a8715.tar.xz |
lib/common.sh: add 'lock_close'; use it as appropriate.
`lock_close FD` is easier to remember than 'exec FD>&-`; and is especially
easier if FD is a variable (though that isn't actually taken advantage of
here).
This uses Bash 4.1+ `exec {var}>&-`, rather than the clunkier
`eval exec "$var>&-"` that was necessary in older versions of Bash.
Thanks to Dave Reisner for pointing this new bit of syntax out to me
the last time I submitted this (back in 2014, 4.1 had just come out).
Diffstat (limited to 'archbuild.in')
-rw-r--r-- | archbuild.in | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/archbuild.in b/archbuild.in index 9c5d706..c1917c3 100644 --- a/archbuild.in +++ b/archbuild.in @@ -58,7 +58,7 @@ if ${clean_first} || [[ ! -d "${chroots}/${repo}-${arch}" ]]; then fi rm -rf --one-file-system "${copy}" done - exec 9>&- + lock_close 9 rm -rf --one-file-system "${chroots}/${repo}-${arch}" mkdir -p "${chroots}/${repo}-${arch}" |