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 master rev: c2cc5abe34169eae92067d97ce1e747e7c1413f5)

(From OE-Core rev: b2706b5b311d456e7da5acf02e25f3f8650c50e5)

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 be40baa5a0
commit 383159ef64

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')