mirror of
https://git.yoctoproject.org/poky
synced 2026-05-30 12:29:55 +00:00
bitbake: fetch: Use OrderedDict for url parameters
Without this, the dict can reorder causing sanity test failures. (Bitbake rev: ca8c91acc9396385834b266d4e8b84d917e5e298) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
@@ -32,6 +32,7 @@ import signal
|
|||||||
import logging
|
import logging
|
||||||
import urllib
|
import urllib
|
||||||
import urlparse
|
import urlparse
|
||||||
|
import collections
|
||||||
import bb.persist_data, bb.utils
|
import bb.persist_data, bb.utils
|
||||||
import bb.checksum
|
import bb.checksum
|
||||||
from bb import data
|
from bb import data
|
||||||
@@ -297,7 +298,7 @@ class URI(object):
|
|||||||
if self.query else '')
|
if self.query else '')
|
||||||
|
|
||||||
def _param_str_split(self, string, elmdelim, kvdelim="="):
|
def _param_str_split(self, string, elmdelim, kvdelim="="):
|
||||||
ret = {}
|
ret = collections.OrderedDict()
|
||||||
for k, v in [x.split(kvdelim, 1) for x in string.split(elmdelim)]:
|
for k, v in [x.split(kvdelim, 1) for x in string.split(elmdelim)]:
|
||||||
ret[k] = v
|
ret[k] = v
|
||||||
return ret
|
return ret
|
||||||
@@ -390,7 +391,7 @@ def decodeurl(url):
|
|||||||
user = ''
|
user = ''
|
||||||
pswd = ''
|
pswd = ''
|
||||||
|
|
||||||
p = {}
|
p = collections.OrderedDict()
|
||||||
if parm:
|
if parm:
|
||||||
for s in parm.split(';'):
|
for s in parm.split(';'):
|
||||||
if s:
|
if s:
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
import unittest
|
import unittest
|
||||||
import tempfile
|
import tempfile
|
||||||
import subprocess
|
import subprocess
|
||||||
|
import collections
|
||||||
import os
|
import os
|
||||||
from bb.fetch2 import URI
|
from bb.fetch2 import URI
|
||||||
from bb.fetch2 import FetchMethod
|
from bb.fetch2 import FetchMethod
|
||||||
@@ -133,10 +134,10 @@ class URITest(unittest.TestCase):
|
|||||||
'userinfo': 'anoncvs:anonymous',
|
'userinfo': 'anoncvs:anonymous',
|
||||||
'username': 'anoncvs',
|
'username': 'anoncvs',
|
||||||
'password': 'anonymous',
|
'password': 'anonymous',
|
||||||
'params': {
|
'params': collections.OrderedDict([
|
||||||
'tag': 'V0-99-81',
|
('tag', 'V0-99-81'),
|
||||||
'module': 'familiar/dist/ipkg'
|
('module', 'familiar/dist/ipkg')
|
||||||
},
|
]),
|
||||||
'query': {},
|
'query': {},
|
||||||
'relative': False
|
'relative': False
|
||||||
},
|
},
|
||||||
@@ -660,7 +661,7 @@ class URLHandle(unittest.TestCase):
|
|||||||
datatable = {
|
datatable = {
|
||||||
"http://www.google.com/index.html" : ('http', 'www.google.com', '/index.html', '', '', {}),
|
"http://www.google.com/index.html" : ('http', 'www.google.com', '/index.html', '', '', {}),
|
||||||
"cvs://anoncvs@cvs.handhelds.org/cvs;module=familiar/dist/ipkg" : ('cvs', 'cvs.handhelds.org', '/cvs', 'anoncvs', '', {'module': 'familiar/dist/ipkg'}),
|
"cvs://anoncvs@cvs.handhelds.org/cvs;module=familiar/dist/ipkg" : ('cvs', 'cvs.handhelds.org', '/cvs', 'anoncvs', '', {'module': 'familiar/dist/ipkg'}),
|
||||||
"cvs://anoncvs:anonymous@cvs.handhelds.org/cvs;tag=V0-99-81;module=familiar/dist/ipkg" : ('cvs', 'cvs.handhelds.org', '/cvs', 'anoncvs', 'anonymous', {'tag': 'V0-99-81', 'module': 'familiar/dist/ipkg'}),
|
"cvs://anoncvs:anonymous@cvs.handhelds.org/cvs;tag=V0-99-81;module=familiar/dist/ipkg" : ('cvs', 'cvs.handhelds.org', '/cvs', 'anoncvs', 'anonymous', collections.OrderedDict([('tag', 'V0-99-81'), ('module', 'familiar/dist/ipkg')])),
|
||||||
"git://git.openembedded.org/bitbake;branch=@foo" : ('git', 'git.openembedded.org', '/bitbake', '', '', {'branch': '@foo'}),
|
"git://git.openembedded.org/bitbake;branch=@foo" : ('git', 'git.openembedded.org', '/bitbake', '', '', {'branch': '@foo'}),
|
||||||
"file://somelocation;someparam=1": ('file', '', 'somelocation', '', '', {'someparam': '1'}),
|
"file://somelocation;someparam=1": ('file', '', 'somelocation', '', '', {'someparam': '1'}),
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user