diff options
author | RPM packaging team <team+pkg-rpm@tracker.debian.org> | 2018-07-24 14:41:23 +0200 |
---|---|---|
committer | Michal Čihař <nijel@debian.org> | 2018-07-24 14:41:23 +0200 |
commit | e4cd5959c43169483dc387f797c81814882a7410 (patch) | |
tree | 3909c1d6d52011de99cfbc1a56d2cf8ace0b6263 | |
parent | dab9866395704a9c457e969ed5e462d209dbb3c4 (diff) |
Use the Debian standard (and safe) mechanism of generating temporary files
Gbp-Pq: Name tempfile.patch
-rwxr-xr-x | scripts/vpkg-provides.sh | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/scripts/vpkg-provides.sh b/scripts/vpkg-provides.sh index 0b86d4b0..5cf63708 100755 --- a/scripts/vpkg-provides.sh +++ b/scripts/vpkg-provides.sh @@ -232,9 +232,9 @@ fi -provides_tmp=${TMPDIR:-/tmp}/provides.$$ -if test -f $provides_tmp ; then - echo "$provides_tmp already exists. Exiting." +provides_tmp=$(tempfile -p provides) +if test -z "$provides_tmp" ; then + echo "unable to make a temp file"; exit 11 fi @@ -247,9 +247,9 @@ do find $d -type f -print 2>/dev/null | grep -E -v \'$ignore_dirs\' | $find_provides >> $provides_tmp done -sum_tmp=${TMPDIR:-/tmp}/sum.$$ -if test -f $sum_tmp ; then - echo "$sum_tmp already exists. Exiting." +sum_tmp=$(tempfile -p sum) +if test -z "$sum_tmp" ; then + echo "unable to make a temp file" exit 11 fi @@ -347,15 +347,15 @@ cat <<_EIEIO_ PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/ucb:/usr/bsd export PATH -sum_current_tmp=\${TMPDIR:-/tmp}/rpm.sum.current.\$\$ -if test -f \$sum_current_tmp ; then - echo "\$sum_current_tmp already exists. Exiting." +sum_current_tmp=\$(tempfile -p sum.current) +if test -z "\$sum_current_tmp" ; then + echo "unable to make a temp file" exit 11 fi -sum_package_tmp=\${TMPDIR:-/tmp}/rpm.sum.package.\$\$ -if test -f \$sum_package_tmp ; then - echo "\$sum_package_tmp already exists. Exiting." +sum_package_tmp=\$(tempfile -p rpm.sum.package) +if test -z "\$sum_package_tmp" ; then + echo "unable to make a temp file" exit 11 fi |