[oe-commits] [openembedded-core] 01/03: oeqa/utils/buildproject: create a more unique tmp dir

git at git.openembedded.org git at git.openembedded.org
Thu Apr 6 09:14:52 UTC 2017


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master
in repository openembedded-core.

commit 9425c2658fea0b45468a04574cd77bffc6668a8d
Author: Joshua Lock <joshua.g.lock at intel.com>
AuthorDate: Wed Apr 5 13:10:53 2017 +0100

    oeqa/utils/buildproject: create a more unique tmp dir
    
    Rather than hardcoding /tmp as the default tmpdir make a more unique tmpdir
    with tempfile.mkdtemp() when the caller doesn't specify a tmpdir value.
    
    Signed-off-by: Joshua Lock <joshua.g.lock at intel.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 meta/lib/oeqa/utils/buildproject.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/meta/lib/oeqa/utils/buildproject.py b/meta/lib/oeqa/utils/buildproject.py
index fc8879c..487f08b 100644
--- a/meta/lib/oeqa/utils/buildproject.py
+++ b/meta/lib/oeqa/utils/buildproject.py
@@ -8,14 +8,17 @@ import os
 import re
 import subprocess
 import shutil
+import tempfile
 
 from abc import ABCMeta, abstractmethod
 
 class BuildProject(metaclass=ABCMeta):
-    def __init__(self, uri, foldername=None, tmpdir="/tmp/", dl_dir=None):
+    def __init__(self, uri, foldername=None, tmpdir=None, dl_dir=None):
         self.uri = uri
         self.archive = os.path.basename(uri)
-        self.localarchive = os.path.join(tmpdir,self.archive)
+        if not tmpdir:
+            tmpdir = tempfile.mkdtemp(prefix='buildproject')
+        self.localarchive = os.path.join(tmpdir, self.archive)
         self.dl_dir = dl_dir
         if foldername:
             self.fname = foldername

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list