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>
This commit is contained in:
parent
ee207d7c7b
commit
d9cf14ff1d
1 changed files with 2 additions and 0 deletions
|
@ -79,6 +79,8 @@ fi
|
||||||
# Generate the new sums and try to unlink the file before writing stdin back
|
# 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,
|
# into it. This final precaution shouldn't fail based on the previous checks,
|
||||||
# but it's better to be extra careful before unlinking files.
|
# 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" &&
|
newsums=$(makepkg -g -p "$buildfile") && rm -f "$buildfile" &&
|
||||||
exec awk -v newsums="$newsums" '
|
exec awk -v newsums="$newsums" '
|
||||||
/^[[:blank:]]*(md|sha)[[:digit:]]+sums=/,/\)[[:blank:]]*(#.*)?$/ {
|
/^[[:blank:]]*(md|sha)[[:digit:]]+sums=/,/\)[[:blank:]]*(#.*)?$/ {
|
||||||
|
|
Loading…
Add table
Reference in a new issue