scripts/*.sh.in: Honor TMPDIR environment variable
Replace "/tmp" with "${TMPDIR:-/tmp}" to allow for overriding the hardcoded path. Since we only use "/tmp" in conjunction with mktemp(1), we could also have used "--tmpdir", which is GNU-ish, however (and the BSD counterpart "-t" has been deprecated in GNU mktemp). Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de> Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
parent
6be492d2f7
commit
35e6136f4b
2 changed files with 2 additions and 2 deletions
|
@ -113,7 +113,7 @@ fi
|
||||||
# do not let pacman run while we do this
|
# do not let pacman run while we do this
|
||||||
touch "$lockfile"
|
touch "$lockfile"
|
||||||
|
|
||||||
workdir=$(mktemp -d /tmp/pacman-optimize.XXXXXXXXXX) ||
|
workdir=$(mktemp -d "${TMPDIR:-/tmp}/pacman-optimize.XXXXXXXXXX") ||
|
||||||
die_r "$(gettext "Can not create temp directory for database building.")\n" >&2
|
die_r "$(gettext "Can not create temp directory for database building.")\n" >&2
|
||||||
|
|
||||||
# step 1: sum the old db
|
# step 1: sum the old db
|
||||||
|
|
|
@ -560,7 +560,7 @@ if [[ $cmd != "repo-add" && $cmd != "repo-remove" ]]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
tmpdir=$(mktemp -d /tmp/repo-tools.XXXXXXXXXX) || (\
|
tmpdir=$(mktemp -d "${TMPDIR:-/tmp}/repo-tools.XXXXXXXXXX") || (\
|
||||||
error "$(gettext "Cannot create temp directory for database building.")"; \
|
error "$(gettext "Cannot create temp directory for database building.")"; \
|
||||||
exit 1)
|
exit 1)
|
||||||
mkdir $tmpdir/tree
|
mkdir $tmpdir/tree
|
||||||
|
|
Loading…
Add table
Reference in a new issue