recipetool: create: avoid traceback on fetch error

If a fetch error occurs, the fetcher already prints a reasonable error -
we don't need the traceback as well, so catch that and exit if it
occurs.

(From OE-Core rev: c2cc5abe34169eae92067d97ce1e747e7c1413f5)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Paul Eggleton 2015-12-22 17:02:56 +13:00 committed by Richard Purdie
parent 470f20bc02
commit c2f17428b8
1 changed files with 5 additions and 1 deletions

View File

@ -122,7 +122,11 @@ def create_recipe(args):
tempsrc = tempfile.mkdtemp(prefix='recipetool-')
srctree = tempsrc
logger.info('Fetching %s...' % srcuri)
checksums = scriptutils.fetch_uri(tinfoil.config_data, fetchuri, srctree, srcrev)
try:
checksums = scriptutils.fetch_uri(tinfoil.config_data, fetchuri, srctree, srcrev)
except bb.fetch2.FetchError:
# Error already printed
sys.exit(1)
dirlist = os.listdir(srctree)
if 'git.indirectionsymlink' in dirlist:
dirlist.remove('git.indirectionsymlink')