mirror of
https://git.yoctoproject.org/poky
synced 2026-05-09 17:39:31 +00:00
fetch/__init__.py: Store url data per .bb file fixing urldata contamination between .bb files.
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@960 311d38ba-8fff-0310-9ca6-ca027cbcb966
This commit is contained in:
@@ -91,7 +91,10 @@ def init(urls = [], d = None):
|
|||||||
ud.method.urls.append(u)
|
ud.method.urls.append(u)
|
||||||
|
|
||||||
def initdata(url, d):
|
def initdata(url, d):
|
||||||
if url not in urldata:
|
fn = bb.data.getVar('FILE', d, 1)
|
||||||
|
if fn not in urldata:
|
||||||
|
urldata[fn] = {}
|
||||||
|
if url not in urldata[fn]:
|
||||||
ud = FetchData()
|
ud = FetchData()
|
||||||
(ud.type, ud.host, ud.path, ud.user, ud.pswd, ud.parm) = bb.decodeurl(data.expand(url, d))
|
(ud.type, ud.host, ud.path, ud.user, ud.pswd, ud.parm) = bb.decodeurl(data.expand(url, d))
|
||||||
ud.date = Fetch.getSRCDate(d)
|
ud.date = Fetch.getSRCDate(d)
|
||||||
@@ -104,15 +107,16 @@ def initdata(url, d):
|
|||||||
ud.localpath = ud.parm["localpath"]
|
ud.localpath = ud.parm["localpath"]
|
||||||
ud.method = m
|
ud.method = m
|
||||||
break
|
break
|
||||||
urldata[url] = ud
|
urldata[fn][url] = ud
|
||||||
return urldata[url]
|
return urldata[fn][url]
|
||||||
|
|
||||||
def go(d):
|
def go(d):
|
||||||
"""Fetch all urls"""
|
"""Fetch all urls"""
|
||||||
|
fn = bb.data.getVar('FILE', d, 1)
|
||||||
for m in methods:
|
for m in methods:
|
||||||
for u in m.urls:
|
for u in m.urls:
|
||||||
ud = urldata[u]
|
ud = urldata[fn][u]
|
||||||
if ud.localfile and not m.forcefetch(u, ud, d) and os.path.exists(urldata[u].md5):
|
if ud.localfile and not m.forcefetch(u, ud, d) and os.path.exists(urldata[fn][u].md5):
|
||||||
# File already present along with md5 stamp file
|
# File already present along with md5 stamp file
|
||||||
# Touch md5 file to show activity
|
# Touch md5 file to show activity
|
||||||
os.utime(ud.md5, None)
|
os.utime(ud.md5, None)
|
||||||
@@ -127,9 +131,10 @@ def go(d):
|
|||||||
def localpaths(d):
|
def localpaths(d):
|
||||||
"""Return a list of the local filenames, assuming successful fetch"""
|
"""Return a list of the local filenames, assuming successful fetch"""
|
||||||
local = []
|
local = []
|
||||||
|
fn = bb.data.getVar('FILE', d, 1)
|
||||||
for m in methods:
|
for m in methods:
|
||||||
for u in m.urls:
|
for u in m.urls:
|
||||||
local.append(urldata[u].localpath)
|
local.append(urldata[fn][u].localpath)
|
||||||
return local
|
return local
|
||||||
|
|
||||||
def localpath(url, d):
|
def localpath(url, d):
|
||||||
|
|||||||
Reference in New Issue
Block a user