summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/lib/oe/recipeutils.py9
-rw-r--r--scripts/lib/devtool/standard.py25
2 files changed, 26 insertions, 8 deletions
diff --git a/meta/lib/oe/recipeutils.py b/meta/lib/oe/recipeutils.py
index 872ff97b89..b04992c66d 100644
--- a/meta/lib/oe/recipeutils.py
+++ b/meta/lib/oe/recipeutils.py
@@ -666,7 +666,7 @@ def get_bbappend_path(d, destlayerdir, wildcardver=False):
666 return (appendpath, pathok) 666 return (appendpath, pathok)
667 667
668 668
669def bbappend_recipe(rd, destlayerdir, srcfiles, install=None, wildcardver=False, machine=None, extralines=None, removevalues=None, redirect_output=None): 669def bbappend_recipe(rd, destlayerdir, srcfiles, install=None, wildcardver=False, machine=None, extralines=None, removevalues=None, redirect_output=None, params=None):
670 """ 670 """
671 Writes a bbappend file for a recipe 671 Writes a bbappend file for a recipe
672 Parameters: 672 Parameters:
@@ -696,6 +696,9 @@ def bbappend_recipe(rd, destlayerdir, srcfiles, install=None, wildcardver=False,
696 redirect_output: 696 redirect_output:
697 If specified, redirects writing the output file to the 697 If specified, redirects writing the output file to the
698 specified directory (for dry-run purposes) 698 specified directory (for dry-run purposes)
699 params:
700 Parameters to use when adding entries to SRC_URI. If specified,
701 should be a list of dicts with the same length as srcfiles.
699 """ 702 """
700 703
701 if not removevalues: 704 if not removevalues:
@@ -762,12 +765,14 @@ def bbappend_recipe(rd, destlayerdir, srcfiles, install=None, wildcardver=False,
762 copyfiles = {} 765 copyfiles = {}
763 if srcfiles: 766 if srcfiles:
764 instfunclines = [] 767 instfunclines = []
765 for newfile, origsrcfile in srcfiles.items(): 768 for i, (newfile, origsrcfile) in enumerate(srcfiles.items()):
766 srcfile = origsrcfile 769 srcfile = origsrcfile
767 srcurientry = None 770 srcurientry = None
768 if not srcfile: 771 if not srcfile:
769 srcfile = os.path.basename(newfile) 772 srcfile = os.path.basename(newfile)
770 srcurientry = 'file://%s' % srcfile 773 srcurientry = 'file://%s' % srcfile
774 if params and params[i]:
775 srcurientry = '%s;%s' % (srcurientry, ';'.join('%s=%s' % (k,v) for k,v in params[i].items()))
771 # Double-check it's not there already 776 # Double-check it's not there already
772 # FIXME do we care if the entry is added by another bbappend that might go away? 777 # FIXME do we care if the entry is added by another bbappend that might go away?
773 if not srcurientry in rd.getVar('SRC_URI').split(): 778 if not srcurientry in rd.getVar('SRC_URI').split():
diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py
index e53569c5cc..c98bfe8195 100644
--- a/scripts/lib/devtool/standard.py
+++ b/scripts/lib/devtool/standard.py
@@ -1606,6 +1606,19 @@ def _update_recipe_patch(recipename, workspace, srctree, rd, appendlayerdir, wil
1606 if not os.path.exists(append): 1606 if not os.path.exists(append):
1607 raise DevtoolError('unable to find workspace bbappend for recipe %s' % 1607 raise DevtoolError('unable to find workspace bbappend for recipe %s' %
1608 recipename) 1608 recipename)
1609 srctreebase = workspace[recipename]['srctreebase']
1610 relpatchdir = os.path.relpath(srctreebase, srctree)
1611 if relpatchdir == '.':
1612 patchdir_params = {}
1613 else:
1614 patchdir_params = {'patchdir': relpatchdir}
1615
1616 def srcuri_entry(fname):
1617 if patchdir_params:
1618 paramstr = ';' + ';'.join('%s=%s' % (k,v) for k,v in patchdir_params.items())
1619 else:
1620 paramstr = ''
1621 return 'file://%s%s' % (basepath, paramstr)
1609 1622
1610 initial_rev, update_rev, changed_revs, filter_patches = _get_patchset_revs(srctree, append, initial_rev, force_patch_refresh) 1623 initial_rev, update_rev, changed_revs, filter_patches = _get_patchset_revs(srctree, append, initial_rev, force_patch_refresh)
1611 if not initial_rev: 1624 if not initial_rev:
@@ -1627,7 +1640,6 @@ def _update_recipe_patch(recipename, workspace, srctree, rd, appendlayerdir, wil
1627 new_f = {} 1640 new_f = {}
1628 del_f = {} 1641 del_f = {}
1629 else: 1642 else:
1630 srctreebase = workspace[recipename]['srctreebase']
1631 upd_f, new_f, del_f = _export_local_files(srctree, rd, local_files_dir, srctreebase) 1643 upd_f, new_f, del_f = _export_local_files(srctree, rd, local_files_dir, srctreebase)
1632 1644
1633 remove_files = [] 1645 remove_files = []
@@ -1663,14 +1675,15 @@ def _update_recipe_patch(recipename, workspace, srctree, rd, appendlayerdir, wil
1663 removedentries, remaining = _remove_file_entries( 1675 removedentries, remaining = _remove_file_entries(
1664 srcuri, remove_files) 1676 srcuri, remove_files)
1665 if removedentries or remaining: 1677 if removedentries or remaining:
1666 remaining = ['file://' + os.path.basename(item) for 1678 remaining = [srcuri_entry(os.path.basename(item)) for
1667 item in remaining] 1679 item in remaining]
1668 removevalues = {'SRC_URI': removedentries + remaining} 1680 removevalues = {'SRC_URI': removedentries + remaining}
1669 appendfile, destpath = oe.recipeutils.bbappend_recipe( 1681 appendfile, destpath = oe.recipeutils.bbappend_recipe(
1670 rd, appendlayerdir, files, 1682 rd, appendlayerdir, files,
1671 wildcardver=wildcard_version, 1683 wildcardver=wildcard_version,
1672 removevalues=removevalues, 1684 removevalues=removevalues,
1673 redirect_output=dry_run_outdir) 1685 redirect_output=dry_run_outdir,
1686 params=[patchdir_params] * len(files))
1674 else: 1687 else:
1675 logger.info('No patches or local source files needed updating') 1688 logger.info('No patches or local source files needed updating')
1676 else: 1689 else:
@@ -1694,7 +1707,7 @@ def _update_recipe_patch(recipename, workspace, srctree, rd, appendlayerdir, wil
1694 # replace the entry in SRC_URI with our local version 1707 # replace the entry in SRC_URI with our local version
1695 logger.info('Replacing remote patch %s with updated local version' % basepath) 1708 logger.info('Replacing remote patch %s with updated local version' % basepath)
1696 path = os.path.join(files_dir, basepath) 1709 path = os.path.join(files_dir, basepath)
1697 _replace_srcuri_entry(srcuri, basepath, 'file://%s' % basepath) 1710 _replace_srcuri_entry(srcuri, basepath, srcuri_entry(basepath))
1698 updaterecipe = True 1711 updaterecipe = True
1699 else: 1712 else:
1700 logger.info('Updating patch %s%s' % (basepath, dry_run_suffix)) 1713 logger.info('Updating patch %s%s' % (basepath, dry_run_suffix))
@@ -1708,7 +1721,7 @@ def _update_recipe_patch(recipename, workspace, srctree, rd, appendlayerdir, wil
1708 os.path.join(files_dir, basepath), 1721 os.path.join(files_dir, basepath),
1709 dry_run_outdir=dry_run_outdir, 1722 dry_run_outdir=dry_run_outdir,
1710 base_outdir=recipedir) 1723 base_outdir=recipedir)
1711 srcuri.append('file://%s' % basepath) 1724 srcuri.append(srcuri_entry(basepath))
1712 updaterecipe = True 1725 updaterecipe = True
1713 for basepath, path in new_p.items(): 1726 for basepath, path in new_p.items():
1714 logger.info('Adding new patch %s%s' % (basepath, dry_run_suffix)) 1727 logger.info('Adding new patch %s%s' % (basepath, dry_run_suffix))
@@ -1716,7 +1729,7 @@ def _update_recipe_patch(recipename, workspace, srctree, rd, appendlayerdir, wil
1716 os.path.join(files_dir, basepath), 1729 os.path.join(files_dir, basepath),
1717 dry_run_outdir=dry_run_outdir, 1730 dry_run_outdir=dry_run_outdir,
1718 base_outdir=recipedir) 1731 base_outdir=recipedir)
1719 srcuri.append('file://%s' % basepath) 1732 srcuri.append(srcuri_entry(basepath))
1720 updaterecipe = True 1733 updaterecipe = True
1721 # Update recipe, if needed 1734 # Update recipe, if needed
1722 if _remove_file_entries(srcuri, remove_files)[0]: 1735 if _remove_file_entries(srcuri, remove_files)[0]: