remove tmp dir in runscript period
authorXiao Jin <jin.xiao@samsung.com>
Fri, 3 Aug 2018 03:12:47 +0000 (11:12 +0800)
committerXiao Jin <jin.xiao@samsung.com>
Fri, 3 Aug 2018 03:12:47 +0000 (11:12 +0800)
Change-Id: I6cfd6e09f8565bae074fe5736a4298fea2461a9d

mic/imager/baseimager.py

index 3762884..f33138e 100644 (file)
@@ -1247,17 +1247,9 @@ class BaseImageCreator(object):
             os.close(fd)
             os.chmod(path, 0700)
 
-            for item in os.listdir(self._imgdir):
-                sub = os.path.splitext(item)[1]
-                if sub == ".img":
-                    shutil.move(os.path.join(self._imgdir, item),
-                                os.path.join(self._instroot + "/tmp", item))
-            oldoutdir = os.getcwd()
-            os.chdir(self._instroot + "/tmp")
-
             env = self._get_sign_scripts_env()
-            #*.img files are moved to self._instroot + "/tmp" directory in running runscripts
-            env['IMG_PATHS'] = env['IMG_PATHS'].replace(self._imgdir,self._instroot + "/tmp")
+            oldoutdir = os.getcwd()
+            os.chdir(self._imgdir)
             try:
                 try:
                     p = subprocess.Popen([s.interp, path],
@@ -1275,9 +1267,6 @@ class BaseImageCreator(object):
             finally:
                 os.chdir(oldoutdir)
                 os.unlink(path)
-                for item in os.listdir(self._instroot + "/tmp"):
-                    shutil.move(os.path.join(self._instroot + "/tmp", item),
-                                os.path.join(self._imgdir, item))
 
     def __run_post_scripts(self):
         msger.info("Running post scripts ...")