[packages/adapter: 526/631] - use mktemp instead of hardcoded tmp path

glen glen at pld-linux.org
Mon Sep 12 20:18:32 CEST 2016


commit bbc531d9bca5eb1d504f478d1a386ed3fa866640
Author: Elan Ruusamäe <glen at pld-linux.org>
Date:   Sat Aug 13 04:58:54 2011 +0000

    - use mktemp instead of hardcoded tmp path
    
    Changed files:
        adapter.awk -> 1.495

 adapter.awk | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
---
diff --git a/adapter.awk b/adapter.awk
index 84a5318..fdbd509 100644
--- a/adapter.awk
+++ b/adapter.awk
@@ -66,7 +66,7 @@ BEGIN {
 	system("[ -d ../PLD-doc ] && cd ../PLD-doc && ([ -f BuildRequires.txt ] || cvs up BuildRequires.txt >/dev/null)");
 
 	# Temporary file for changelog section
-	changelog_file = ENVIRON["HOME"] "/tmp/adapter.changelog"
+	changelog_file = mktemp("adapter.changelogXXXXXX")
 }
 
 # There should be a comment with CVS keywords on the first line of file.
@@ -93,6 +93,12 @@ defattr == 1 {
 	defattr = 0
 }
 
+# call mktemp(1) and return the value
+function mktemp(template, tmp) {
+   "mktemp " template | getline tmp
+   return tmp
+}
+
 function b_makekey(a, b,	s) {
 	s = a "" b;
 	# kill bcond
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/adapter.git/commitdiff/6ca0126d4d0c8c79feb7db10b0a0fade0f3b8885



More information about the pld-cvs-commit mailing list