diff options
Diffstat (limited to 'lib/bb/fetch2/perforce.py')
-rw-r--r-- | lib/bb/fetch2/perforce.py | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/lib/bb/fetch2/perforce.py b/lib/bb/fetch2/perforce.py index 5c128b3fd..e98440f59 100644 --- a/lib/bb/fetch2/perforce.py +++ b/lib/bb/fetch2/perforce.py @@ -156,8 +156,7 @@ class Perforce(Fetch): tmppipe = os.popen(data.getVar('MKTEMPDIRCMD', localdata, 1) or "false") tmpfile = tmppipe.readline().strip() if not tmpfile: - logger.error("Fetch: unable to create temporary directory.. make sure 'mktemp' is in the PATH.") - raise FetchError(module) + raise FetchError("Fetch: unable to create temporary directory.. make sure 'mktemp' is in the PATH.", loc) if "label" in parm: depot = "%s@%s" % (depot, parm["label"]) @@ -171,8 +170,7 @@ class Perforce(Fetch): p4file = os.popen("%s%s files %s" % (p4cmd, p4opt, depot)) if not p4file: - logger.error("Fetch: unable to get the P4 files from %s", depot) - raise FetchError(module) + raise FetchError("Fetch: unable to get the P4 files from %s" % depot, loc) count = 0 @@ -189,15 +187,9 @@ class Perforce(Fetch): count = count + 1 if count == 0: - logger.error("Fetch: No files gathered from the P4 fetch") - raise FetchError(module) - - myret = os.system("tar -czf %s %s" % (ud.localpath, module)) - if myret != 0: - try: - os.unlink(ud.localpath) - except OSError: - pass - raise FetchError(module) + logger.error() + raise FetchError("Fetch: No files gathered from the P4 fetch", loc) + + runfetchcmd("tar -czf %s %s" % (ud.localpath, module), d, cleanup = [ud.localpath]) # cleanup bb.utils.prunedir(tmpfile) |