binman: Allow extracting to current directory
authorSimon Glass <sjg@chromium.org>
Thu, 18 Mar 2021 07:24:51 +0000 (20:24 +1300)
committerSimon Glass <sjg@chromium.org>
Fri, 26 Mar 2021 04:03:09 +0000 (17:03 +1300)
Extracting files to the current directory is not normally a very friendly
thing to do, but it can be warranted, e.g. in a new temporary dir. At
present binman reports an error when such an attempt is made. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
tools/binman/control.py

index 1952b2a..9c0cafe 100644 (file)
@@ -241,7 +241,7 @@ def ExtractEntries(image_fname, output_fname, outdir, entry_paths,
         # If this entry has children, create a directory for it and put its
         # data in a file called 'root' in that directory
         if entry.GetEntries():
-            if not os.path.exists(fname):
+            if fname and not os.path.exists(fname):
                 os.makedirs(fname)
             fname = os.path.join(fname, 'root')
         tout.Notice("Write entry '%s' size %x to '%s'" %