All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [autobuild 1/4] autobuild-run: prevent send_result from failing when gathering config files
@ 2015-04-12 14:34 Samuel Martin
  2015-04-12 14:34 ` [Buildroot] [autobuild 2/4] autobuild-run: also save CMake config log files on package failure Samuel Martin
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Samuel Martin @ 2015-04-12 14:34 UTC (permalink / raw)
  To: buildroot

- Make sure using absolute paths in os.path.relpath();
- os.makedirs() can fail if the directory already exists, so only create it
  when needed.

Signed-off-by: Samuel Martin <s.martin49@gmail.com>
---
 scripts/autobuild-run | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/scripts/autobuild-run b/scripts/autobuild-run
index 0e12080..a19d51b 100755
--- a/scripts/autobuild-run
+++ b/scripts/autobuild-run
@@ -653,15 +653,16 @@ def send_results(result, **kwargs):
         if not reason:
             return
 
-        srcroot = os.path.join(outputdir, "build", '-'.join(reason))
-        destroot = os.path.join(resultdir, '-'.join(reason))
+        srcroot = os.path.abspath(os.path.join(outputdir, "build", '-'.join(reason)))
+        destroot = os.path.abspath(os.path.join(resultdir, '-'.join(reason)))
 
         for root, dirs, files in os.walk(srcroot):
             dest = os.path.join(destroot, os.path.relpath(root, srcroot))
 
             for fname in files:
                 if fname == 'config.log':
-                    os.makedirs(dest)
+                    if not os.path.exists(dest):
+                        os.makedirs(dest)
                     shutil.copy(os.path.join(root, fname), os.path.join(dest, fname))
 
     copy_config_log_files()
-- 
2.3.5

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2015-04-13 12:34 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-12 14:34 [Buildroot] [autobuild 1/4] autobuild-run: prevent send_result from failing when gathering config files Samuel Martin
2015-04-12 14:34 ` [Buildroot] [autobuild 2/4] autobuild-run: also save CMake config log files on package failure Samuel Martin
2015-04-12 14:34 ` [Buildroot] [autobuild 3/4] autobuild-run: sanitize make options Samuel Martin
2015-04-12 17:22   ` Thomas Petazzoni
2015-04-12 18:20     ` Samuel Martin
2015-04-12 14:34 ` [Buildroot] [autobuild 4/4] autobuild-run: allow to change default git uri and branch through env. vars Samuel Martin
2015-04-12 17:26   ` Thomas Petazzoni
2015-04-12 18:06     ` Samuel Martin
2015-04-13 12:34       ` Matthew Weber
2015-04-12 17:20 ` [Buildroot] [autobuild 1/4] autobuild-run: prevent send_result from failing when gathering config files Thomas Petazzoni
2015-04-12 18:15   ` Samuel Martin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.