diff options
Diffstat (limited to 'scripts/lib')
-rw-r--r-- | scripts/lib/recipetool/create.py | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/scripts/lib/recipetool/create.py b/scripts/lib/recipetool/create.py index 923c336849..2b7cc76ccb 100644 --- a/scripts/lib/recipetool/create.py +++ b/scripts/lib/recipetool/create.py | |||
@@ -478,20 +478,11 @@ def create_recipe(args): | |||
478 | bb.process.run('git submodule update --init --recursive', cwd=srctree) | 478 | bb.process.run('git submodule update --init --recursive', cwd=srctree) |
479 | 479 | ||
480 | if is_package(fetchuri): | 480 | if is_package(fetchuri): |
481 | tmpfdir = tempfile.mkdtemp(prefix='recipetool-') | 481 | localdata = bb.data.createCopy(tinfoil.config_data) |
482 | try: | 482 | pkgfile = bb.fetch2.localpath(fetchuri, localdata) |
483 | pkgfile = None | 483 | if pkgfile: |
484 | tmpfdir = tempfile.mkdtemp(prefix='recipetool-') | ||
484 | try: | 485 | try: |
485 | fileuri = fetchuri + ';unpack=0' | ||
486 | scriptutils.fetch_uri(tinfoil.config_data, fileuri, tmpfdir, srcrev) | ||
487 | for root, _, files in os.walk(tmpfdir): | ||
488 | for f in files: | ||
489 | pkgfile = os.path.join(root, f) | ||
490 | break | ||
491 | except bb.fetch2.BBFetchException as e: | ||
492 | logger.warn('Second fetch to get metadata failed: %s' % str(e).rstrip()) | ||
493 | |||
494 | if pkgfile: | ||
495 | if pkgfile.endswith(('.deb', '.ipk')): | 486 | if pkgfile.endswith(('.deb', '.ipk')): |
496 | stdout, _ = bb.process.run('ar x %s' % pkgfile, cwd=tmpfdir) | 487 | stdout, _ = bb.process.run('ar x %s' % pkgfile, cwd=tmpfdir) |
497 | stdout, _ = bb.process.run('tar xf control.tar.gz', cwd=tmpfdir) | 488 | stdout, _ = bb.process.run('tar xf control.tar.gz', cwd=tmpfdir) |
@@ -501,8 +492,8 @@ def create_recipe(args): | |||
501 | stdout, _ = bb.process.run('rpm -qp --xml %s > pkginfo.xml' % pkgfile, cwd=tmpfdir) | 492 | stdout, _ = bb.process.run('rpm -qp --xml %s > pkginfo.xml' % pkgfile, cwd=tmpfdir) |
502 | values = convert_rpm_xml(os.path.join(tmpfdir, 'pkginfo.xml')) | 493 | values = convert_rpm_xml(os.path.join(tmpfdir, 'pkginfo.xml')) |
503 | extravalues.update(values) | 494 | extravalues.update(values) |
504 | finally: | 495 | finally: |
505 | shutil.rmtree(tmpfdir) | 496 | shutil.rmtree(tmpfdir) |
506 | else: | 497 | else: |
507 | # Assume we're pointing to an existing source tree | 498 | # Assume we're pointing to an existing source tree |
508 | if args.extract_to: | 499 | if args.extract_to: |