diff options
author | Dave Reisner <dreisner@archlinux.org> | 2014-09-07 18:37:34 +0200 |
---|---|---|
committer | Allan McRae <allan@archlinux.org> | 2014-09-15 01:33:07 +0200 |
commit | d9cf14ff1d69ac8834b84015c7971f55ce77645b (patch) | |
tree | 388aadd4b3c6651028b2b0aec59cb0bf5d574d14 /contrib/updpkgsums.sh.in | |
parent | ee207d7c7b34ca54ad9bf65952eb1d567ef41ceb (diff) | |
download | pacman-d9cf14ff1d69ac8834b84015c7971f55ce77645b.tar.gz pacman-d9cf14ff1d69ac8834b84015c7971f55ce77645b.tar.xz |
updpkgsums: use a throwaway build dir
This prevents updpkgsums from potentially dirtying an otherwise pristine
directory (likely $PWD) when makepkg creates the srclinks.
Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'contrib/updpkgsums.sh.in')
-rw-r--r-- | contrib/updpkgsums.sh.in | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/contrib/updpkgsums.sh.in b/contrib/updpkgsums.sh.in index 7e680b8e..d41e362e 100644 --- a/contrib/updpkgsums.sh.in +++ b/contrib/updpkgsums.sh.in @@ -79,6 +79,8 @@ fi # Generate the new sums and try to unlink the file before writing stdin back # into it. This final precaution shouldn't fail based on the previous checks, # but it's better to be extra careful before unlinking files. + export BUILDDIR=$(mktemp -d --tmpdir updpkgsums.XXXXXX) + trap "rm -rf '$BUILDDIR'" EXIT newsums=$(makepkg -g -p "$buildfile") && rm -f "$buildfile" && exec awk -v newsums="$newsums" ' /^[[:blank:]]*(md|sha)[[:digit:]]+sums=/,/\)[[:blank:]]*(#.*)?$/ { |