commit:     479b2386c8de40a17bc4de4c0723f8c189f14a90
Author:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
AuthorDate: Sat Mar 23 06:36:00 2019 +0000
Commit:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
CommitDate: Sat Mar 23 08:11:08 2019 +0000
URL:        https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=479b2386

Use mktemp for $TEMP

Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>

 gen_cmdline.sh | 2 +-
 genkernel      | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/gen_cmdline.sh b/gen_cmdline.sh
index 9bdc157..051350a 100755
--- a/gen_cmdline.sh
+++ b/gen_cmdline.sh
@@ -564,7 +564,7 @@ parse_cmdline() {
                        ;;
                --tempdir=*)
                        TMPDIR="${*#*=}"
-                       TEMP=${TMPDIR}/$RANDOM.$RANDOM.$RANDOM.$$
+                       TEMP=$(mktemp -d -p "${TMPDIR}" gk.XXXXXXXX)
                        print_info 2 "TMPDIR: ${TMPDIR}"
                        print_info 2 "TEMP: ${TEMP}"
                        ;;

diff --git a/genkernel b/genkernel
index eca6ea0..c8a9925 100755
--- a/genkernel
+++ b/genkernel
@@ -44,7 +44,7 @@ source ${GK_SHARE}/gen_moddeps.sh || gen_die "Could not read 
${GK_SHARE}/gen_mod
 source ${GK_SHARE}/gen_package.sh || gen_die "Could not read 
${GK_SHARE}/gen_package.sh"
 source ${GK_SHARE}/gen_bootloader.sh || gen_die "Could not read 
${GK_SHARE}/gen_bootloader.sh"
 
-TEMP=${TMPDIR}/$RANDOM.$RANDOM.$RANDOM.$$
+TEMP=$(mktemp -d -p "${TMPDIR}" gk.XXXXXXXX)
 
 trap_cleanup(){
        # Call exit code of 1 for failure

Reply via email to