Permalink
Browse files

Remove --tmpdir from mktemp invocations

Systems with older versions of mktemp (RHEL5 for example which has not
yet started using mktemp from coreutils) cannot accept the new --tmpdir
options used.  Instead this patch follows the intent of that option,
checking if $TMPDIR is set and if not falling back to /tmp.

Signed-off-by: Jim Ramsay <jim_ramsay@dell.com>
  • Loading branch information...
Jim Ramsay authored and superm1 committed Jun 30, 2011
1 parent dd0bfd5 commit 7e702e57e033dde25e2fc7ef9ff36e45894454ca
Showing with 4 additions and 2 deletions.
  1. +2 −1 dkms
  2. +2 −1 dkms_find-provides
View
3 dkms
@@ -3314,7 +3314,8 @@ current_kernel=$(uname -r)
dkms_tree="/var/lib/dkms"
source_tree="/usr/src"
install_tree="/lib/modules"
tmp_file=`mktemp --tmpdir dkms.XXXXXXXX`
tmp=${TMPDIR:-/tmp}
tmp_file=`mktemp $tmp/dkms.XXXXXXXX`
tmp_location=`dirname $tmp_file`
verbose=""
dkms_frameworkconf="/etc/dkms/framework.conf"
View
@@ -59,7 +59,8 @@ get_modinfo() {
}
TMPDIR=$(mktemp -d --tmpdir dkms-findprovides-$$-$RANDOM-XXXXXX)
tmp=${TMPDIR:-/tmp}
TMPDIR=$(mktemp -d ${tmp}/dkms-findprovides-$$-$RANDOM-XXXXXX)
trap "rm -rf $TMPDIR >/dev/null 2>&1" QUIT EXIT HUP INT TERM
modlist=

0 comments on commit 7e702e5

Please sign in to comment.