On 29 June 2015 at 08:20, <[email protected]> wrote:
> + # Check if /tmp is writable
> + from string import ascii_letters
> + from random import choice
> + filename = "bb_writetest.%s" % os.getpid()
> + testfile = os.path.join("/tmp", filename)
>
Use tempfile.mkstemp() here, we'll get proper unique names and it will use
the same temporary directory as gcc etc.
> + try:
> + f = open(testfile, "w")
> + f.write("".join(choice(ascii_letters) for x in range(1024)))
> + f.close()
> + os.remove(testfile)
> + except:
> + status.addresult("Failed to write into /tmp. Please verify your
> filesystem.")
>
The error should include the message from the exception to help root-cause
the problem.
Ross
--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core