summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/fetch2/__init__.py
diff options
context:
space:
mode:
authorPaul Barker <pbarker@konsulko.com>2020-06-03 20:31:16 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-06-04 13:28:16 +0100
commit1251765fff1c12d943091a2981b347e721b93e4e (patch)
treecbef15da992e57589c5be19167f33c05fe339c8f /bitbake/lib/bb/fetch2/__init__.py
parentd64809679436e9338555ef4e75ea6def93fc09c3 (diff)
downloadpoky-1251765fff1c12d943091a2981b347e721b93e4e.tar.gz
bitbake: fetch2: Add the ability to list expanded URL data
Some fetchers may download additional sources along with those explicitly listed in SRC_URI. These "implicit URLs" will be needed by the archiver to ensure that all sources can be archived. We can't just return a list of URL strings since each URL may need its own SRCREV data so we return a list of FetchData objects. Each fetcher can override the implicit_urldata() function to provide the additional FetchData objects. For now this is just needed in the gitsm fetcher to walk git submodules recursively. (Bitbake rev: 1350f241b7d991bd191ce9e44f6662e4376c6e24) Signed-off-by: Paul Barker <pbarker@konsulko.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/fetch2/__init__.py')
-rw-r--r--bitbake/lib/bb/fetch2/__init__.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/bitbake/lib/bb/fetch2/__init__.py b/bitbake/lib/bb/fetch2/__init__.py
index eb112f069d..756f60212f 100644
--- a/bitbake/lib/bb/fetch2/__init__.py
+++ b/bitbake/lib/bb/fetch2/__init__.py
@@ -1617,6 +1617,13 @@ class FetchMethod(object):
1617 return True 1617 return True
1618 return False 1618 return False
1619 1619
1620 def implicit_urldata(self, ud, d):
1621 """
1622 Get a list of FetchData objects for any implicit URLs that will also
1623 be downloaded when we fetch the given URL.
1624 """
1625 return []
1626
1620class Fetch(object): 1627class Fetch(object):
1621 def __init__(self, urls, d, cache = True, localonly = False, connection_cache = None): 1628 def __init__(self, urls, d, cache = True, localonly = False, connection_cache = None):
1622 if localonly and cache: 1629 if localonly and cache:
@@ -1842,6 +1849,24 @@ class Fetch(object):
1842 if ud.lockfile: 1849 if ud.lockfile:
1843 bb.utils.unlockfile(lf) 1850 bb.utils.unlockfile(lf)
1844 1851
1852 def expanded_urldata(self, urls=None):
1853 """
1854 Get an expanded list of FetchData objects covering both the given
1855 URLS and any additional implicit URLs that are added automatically by
1856 the appropriate FetchMethod.
1857 """
1858
1859 if not urls:
1860 urls = self.urls
1861
1862 urldata = []
1863 for url in urls:
1864 ud = self.ud[url]
1865 urldata.append(ud)
1866 urldata += ud.method.implicit_urldata(ud, self.d)
1867
1868 return urldata
1869
1845class FetchConnectionCache(object): 1870class FetchConnectionCache(object):
1846 """ 1871 """
1847 A class which represents an container for socket connections. 1872 A class which represents an container for socket connections.