diff options
author | Martin Jansa <martin.jansa@gmail.com> | 2013-08-07 00:09:49 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-08-12 13:09:50 +0100 |
commit | 5c7b8fc342b19080ec02012156eb53c038794d69 (patch) | |
tree | ccce6f97af0cc2781dc65fd4c53a0f0d591cbd1f /meta/classes/buildhistory.bbclass | |
parent | 560dac6e7db76f533f98eda969f585e4eb416e6e (diff) | |
download | poky-5c7b8fc342b19080ec02012156eb53c038794d69.tar.gz |
buildhistory: use bb.utils.mkdirhier instead of os.makedirs
* Multiple do_fetch[prefunc] can happen at the same time and
if not os.path.exists(pkghistdir):
os.makedirs(pkghistdir)
isn't safe
* Use bb.utils.mkdirhier which doesn't raise error when directory exists
(From OE-Core rev: 9aac194d7db79129dcbed29cfb89c57dccf33729)
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/buildhistory.bbclass')
-rw-r--r-- | meta/classes/buildhistory.bbclass | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/meta/classes/buildhistory.bbclass b/meta/classes/buildhistory.bbclass index 55b6bbf496..c32c7aa868 100644 --- a/meta/classes/buildhistory.bbclass +++ b/meta/classes/buildhistory.bbclass | |||
@@ -169,7 +169,7 @@ python buildhistory_emit_pkghistory() { | |||
169 | 169 | ||
170 | packagelist = packages.split() | 170 | packagelist = packages.split() |
171 | if not os.path.exists(pkghistdir): | 171 | if not os.path.exists(pkghistdir): |
172 | os.makedirs(pkghistdir) | 172 | bb.utils.mkdirhier(pkghistdir) |
173 | else: | 173 | else: |
174 | # Remove files for packages that no longer exist | 174 | # Remove files for packages that no longer exist |
175 | for item in os.listdir(pkghistdir): | 175 | for item in os.listdir(pkghistdir): |
@@ -268,7 +268,7 @@ def write_pkghistory(pkginfo, d): | |||
268 | 268 | ||
269 | pkgpath = os.path.join(pkghistdir, pkginfo.name) | 269 | pkgpath = os.path.join(pkghistdir, pkginfo.name) |
270 | if not os.path.exists(pkgpath): | 270 | if not os.path.exists(pkgpath): |
271 | os.makedirs(pkgpath) | 271 | bb.utils.mkdirhier(pkgpath) |
272 | 272 | ||
273 | infofile = os.path.join(pkgpath, "latest") | 273 | infofile = os.path.join(pkgpath, "latest") |
274 | with open(infofile, "w") as f: | 274 | with open(infofile, "w") as f: |
@@ -579,7 +579,7 @@ python write_srcrev() { | |||
579 | srcrevs, tag_srcrevs = _get_srcrev_values(d) | 579 | srcrevs, tag_srcrevs = _get_srcrev_values(d) |
580 | if srcrevs: | 580 | if srcrevs: |
581 | if not os.path.exists(pkghistdir): | 581 | if not os.path.exists(pkghistdir): |
582 | os.makedirs(pkghistdir) | 582 | bb.utils.mkdirhier(pkghistdir) |
583 | old_tag_srcrevs = {} | 583 | old_tag_srcrevs = {} |
584 | if os.path.exists(srcrevfile): | 584 | if os.path.exists(srcrevfile): |
585 | with open(srcrevfile) as f: | 585 | with open(srcrevfile) as f: |