bmaptool: do not feed stdout to BmapCreate
authorArtem Bityutskiy <artem.bityutskiy@intel.com>
Fri, 3 May 2013 13:48:40 +0000 (16:48 +0300)
committerArtem Bityutskiy <artem.bityutskiy@intel.com>
Mon, 6 May 2013 14:58:51 +0000 (17:58 +0300)
commit79ea9623f74aef5cc2d11b2b281fcc71c2ddf029
treef6078483c53adf45cd40ddf8ae551d9603ffc092
parent000309ce91f7b8eb967745fa426e07cf648f8b4b
bmaptool: do not feed stdout to BmapCreate

We are going to modify BmapCreate to support bmap file checksum. And we'll have
to seek the bmap file. However, the problem is that bmaptool may feed
BmapCreate with stdout which is not seekable.

This patch changes bmaptool and makes it create a temporary file when the user
does not specify the output file, give it to BmapCreate, and then print the
contents of the file to stdout. We use the 'NamedTemporaryFile' python method
which automatically removes the file when the program crashes or is interrupted
with Ctrl-C.

Change-Id: I0ad16136111095b04cf3a0e9223c004b493c26de
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
bmaptool