]> git.droids-corp.org - dpdk.git/commitdiff
devtools: use a common prefix for temporary files
authorThomas Monjalon <thomas@monjalon.net>
Wed, 19 Sep 2018 17:16:29 +0000 (19:16 +0200)
committerThomas Monjalon <thomas@monjalon.net>
Mon, 1 Oct 2018 21:51:45 +0000 (23:51 +0200)
Some temporary files were generated in /tmp, others in the current
directory, and none was "dpdk prefixed".

All these files have a common path prefix now: $TMPDIR/dpdk.
TMPDIR is /tmp by default.

Note: the previous use of mktemp, with a template but without -t,
was generating a file in the current directory.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
buildtools/auto-config-h.sh
devtools/check-includes.sh
devtools/check-symbol-change.sh
devtools/checkpatches.sh
devtools/cocci.sh

index d28a5c3ad9bc53def43023de912e3f99f2b392eb..6130429eb51892f3044720766eada3ca2c7e3d8d 100755 (executable)
@@ -23,7 +23,7 @@ name=${5:?define/type/function name required}
 
 : ${CC:=cc}
 
-temp=/tmp/${0##*/}.$$.c
+temp=$(mktemp -t dpdk.${0##*/}.XXX.c)
 
 case $type in
 define)
index 9057633e73b2c9f186a8781c4394c07eb626cbc0..ba9d00ba33f4ca98e069636c601a8d666c69d7db 100755 (executable)
@@ -90,11 +90,11 @@ include_dir=${1:-build/include}
        'rte_eth_vhost.h' \
 }
 
-temp_cc=/tmp/${0##*/}.$$.c
+temp_cc=$(mktemp -t dpdk.${0##*/}.XXX.c)
 pass_cc=
 failures_cc=0
 
-temp_cxx=/tmp/${0##*/}.$$.cc
+temp_cxx=$(mktemp -t dpdk.${0##*/}.XXX.cc)
 pass_cxx=
 failures_cxx=0
 
index cf9cfc745bea272498823805f1b8a418b7b356f7..c0d2a6da18bdfee4d15fa33b56bd198fcbe529dd 100755 (executable)
@@ -140,7 +140,7 @@ check_for_rule_violations()
 
 trap clean_and_exit_on_sig EXIT
 
-mapfile=`mktemp mapdb.XXXXXX`
+mapfile=`mktemp -t dpdk.mapdb.XXXXXX`
 patch=$1
 exit_code=1
 
index dbed422e88e65baa6bc990f08e9fb3504665cb5a..bf3114f954d04c75bd9f31017a47432b4b2f6e10 100755 (executable)
@@ -90,11 +90,11 @@ check () { # <patch> <commit> <title>
        if [ -n "$1" ] ; then
                tmpinput=$1
        elif [ -n "$2" ] ; then
-               tmpinput=$(mktemp checkpatches.XXXXXX)
+               tmpinput=$(mktemp -t dpdk.checkpatches.XXXXXX)
                git format-patch --find-renames \
                --no-stat --stdout -1 $commit > "$tmpinput"
        else
-               tmpinput=$(mktemp checkpatches.XXXXXX)
+               tmpinput=$(mktemp -t dpdk.checkpatches.XXXXXX)
                cat > "$tmpinput"
        fi
 
index 4ca5025f78040a9572184bc13bb5668a5cd0e836..8b17a8cebac36effead7c2be2b3de337474eac43 100755 (executable)
@@ -44,7 +44,7 @@ PATCH_LIST="$@"
        exit 1
 )
 
-tmp=$(mktemp)
+tmp=$(mktemp -t dpdk.cocci.XXX)
 
 for c in $PATCH_LIST; do
        while true; do