mirror of
https://git.yoctoproject.org/poky
synced 2026-09-29 07:36:20 +02:00
bb.fetch2: replace bb.fetch with bb.fetch2 in the bb.fetch
bb.fetch2 is copied from bb.fetch, and has many bb.fetch referrence. Fix these referrence with bb.fetch2 referrence Signed-off-by: Yu Ke <ke.yu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
@@ -134,9 +134,9 @@ def uri_replace(uri, uri_find, uri_replace, d):
|
|||||||
result_decoded[loc] = re.sub(i, uri_replace_decoded[loc], uri_decoded[loc])
|
result_decoded[loc] = re.sub(i, uri_replace_decoded[loc], uri_decoded[loc])
|
||||||
if uri_find_decoded.index(i) == 2:
|
if uri_find_decoded.index(i) == 2:
|
||||||
if d:
|
if d:
|
||||||
localfn = bb.fetch.localpath(uri, d)
|
localfn = bb.fetch2.localpath(uri, d)
|
||||||
if localfn:
|
if localfn:
|
||||||
result_decoded[loc] = os.path.join(os.path.dirname(result_decoded[loc]), os.path.basename(bb.fetch.localpath(uri, d)))
|
result_decoded[loc] = os.path.join(os.path.dirname(result_decoded[loc]), os.path.basename(bb.fetch2.localpath(uri, d)))
|
||||||
else:
|
else:
|
||||||
return uri
|
return uri
|
||||||
return encodeurl(result_decoded)
|
return encodeurl(result_decoded)
|
||||||
@@ -158,7 +158,7 @@ def fetcher_init(d):
|
|||||||
elif srcrev_policy == "clear":
|
elif srcrev_policy == "clear":
|
||||||
logger.debug(1, "Clearing SRCREV cache due to cache policy of: %s", srcrev_policy)
|
logger.debug(1, "Clearing SRCREV cache due to cache policy of: %s", srcrev_policy)
|
||||||
try:
|
try:
|
||||||
bb.fetch.saved_headrevs = pd['BB_URI_HEADREVS'].items()
|
bb.fetch2.saved_headrevs = pd['BB_URI_HEADREVS'].items()
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
del pd['BB_URI_HEADREVS']
|
del pd['BB_URI_HEADREVS']
|
||||||
@@ -177,7 +177,7 @@ def fetcher_compare_revisions(d):
|
|||||||
|
|
||||||
pd = persist_data.persist(d)
|
pd = persist_data.persist(d)
|
||||||
data = pd['BB_URI_HEADREVS'].items()
|
data = pd['BB_URI_HEADREVS'].items()
|
||||||
data2 = bb.fetch.saved_headrevs
|
data2 = bb.fetch2.saved_headrevs
|
||||||
|
|
||||||
changed = False
|
changed = False
|
||||||
for key in data:
|
for key in data:
|
||||||
@@ -378,7 +378,7 @@ def get_srcrev(d):
|
|||||||
#
|
#
|
||||||
# Neater solutions welcome!
|
# Neater solutions welcome!
|
||||||
#
|
#
|
||||||
if bb.fetch.srcrev_internal_call:
|
if bb.fetch2.srcrev_internal_call:
|
||||||
return "SRCREVINACTION"
|
return "SRCREVINACTION"
|
||||||
|
|
||||||
scms = []
|
scms = []
|
||||||
@@ -494,7 +494,7 @@ def try_mirrors(d, uri, mirrors, check = False, force = False):
|
|||||||
if newuri != uri:
|
if newuri != uri:
|
||||||
try:
|
try:
|
||||||
ud = FetchData(newuri, ld)
|
ud = FetchData(newuri, ld)
|
||||||
except bb.fetch.NoMethodError:
|
except bb.fetch2.NoMethodError:
|
||||||
logger.debug(1, "No method for %s", uri)
|
logger.debug(1, "No method for %s", uri)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
@@ -508,9 +508,9 @@ def try_mirrors(d, uri, mirrors, check = False, force = False):
|
|||||||
else:
|
else:
|
||||||
ud.method.go(newuri, ud, ld)
|
ud.method.go(newuri, ud, ld)
|
||||||
return ud.localpath
|
return ud.localpath
|
||||||
except (bb.fetch.MissingParameterError,
|
except (bb.fetch2.MissingParameterError,
|
||||||
bb.fetch.FetchError,
|
bb.fetch2.FetchError,
|
||||||
bb.fetch.MD5SumError):
|
bb.fetch2.MD5SumError):
|
||||||
import sys
|
import sys
|
||||||
(type, value, traceback) = sys.exc_info()
|
(type, value, traceback) = sys.exc_info()
|
||||||
logger.debug(2, "Mirror fetch failure: %s", value)
|
logger.debug(2, "Mirror fetch failure: %s", value)
|
||||||
@@ -571,10 +571,10 @@ class FetchData(object):
|
|||||||
self.localpath = local
|
self.localpath = local
|
||||||
if not local:
|
if not local:
|
||||||
try:
|
try:
|
||||||
bb.fetch.srcrev_internal_call = True
|
bb.fetch2.srcrev_internal_call = True
|
||||||
self.localpath = self.method.localpath(self.url, self, d)
|
self.localpath = self.method.localpath(self.url, self, d)
|
||||||
finally:
|
finally:
|
||||||
bb.fetch.srcrev_internal_call = False
|
bb.fetch2.srcrev_internal_call = False
|
||||||
# We have to clear data's internal caches since the cached value of SRCREV is now wrong.
|
# We have to clear data's internal caches since the cached value of SRCREV is now wrong.
|
||||||
# Horrible...
|
# Horrible...
|
||||||
bb.data.delVar("ISHOULDNEVEREXIST", d)
|
bb.data.delVar("ISHOULDNEVEREXIST", d)
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ import sys
|
|||||||
import logging
|
import logging
|
||||||
import bb
|
import bb
|
||||||
from bb import data
|
from bb import data
|
||||||
from bb.fetch import Fetch, FetchError, runfetchcmd, logger
|
from bb.fetch2 import Fetch, FetchError, runfetchcmd, logger
|
||||||
|
|
||||||
class Bzr(Fetch):
|
class Bzr(Fetch):
|
||||||
def supports(self, url, ud, d):
|
def supports(self, url, ud, d):
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ import os
|
|||||||
import logging
|
import logging
|
||||||
import bb
|
import bb
|
||||||
from bb import data
|
from bb import data
|
||||||
from bb.fetch import Fetch, FetchError, MissingParameterError, logger
|
from bb.fetch2 import Fetch, FetchError, MissingParameterError, logger
|
||||||
|
|
||||||
class Cvs(Fetch):
|
class Cvs(Fetch):
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -23,9 +23,9 @@ BitBake 'Fetch' git implementation
|
|||||||
import os
|
import os
|
||||||
import bb
|
import bb
|
||||||
from bb import data
|
from bb import data
|
||||||
from bb.fetch import Fetch
|
from bb.fetch2 import Fetch
|
||||||
from bb.fetch import runfetchcmd
|
from bb.fetch2 import runfetchcmd
|
||||||
from bb.fetch import logger
|
from bb.fetch2 import logger
|
||||||
|
|
||||||
class Git(Fetch):
|
class Git(Fetch):
|
||||||
"""Class to fetch a module or modules from git repositories"""
|
"""Class to fetch a module or modules from git repositories"""
|
||||||
@@ -225,7 +225,7 @@ class Git(Fetch):
|
|||||||
cmd = "%s ls-remote %s://%s%s%s %s" % (basecmd, ud.proto, username, ud.host, ud.path, ud.branch)
|
cmd = "%s ls-remote %s://%s%s%s %s" % (basecmd, ud.proto, username, ud.host, ud.path, ud.branch)
|
||||||
output = runfetchcmd(cmd, d, True)
|
output = runfetchcmd(cmd, d, True)
|
||||||
if not output:
|
if not output:
|
||||||
raise bb.fetch.FetchError("Fetch command %s gave empty output\n" % (cmd))
|
raise bb.fetch2.FetchError("Fetch command %s gave empty output\n" % (cmd))
|
||||||
return output.split()[0]
|
return output.split()[0]
|
||||||
|
|
||||||
def _build_revision(self, url, ud, d):
|
def _build_revision(self, url, ud, d):
|
||||||
|
|||||||
@@ -29,11 +29,11 @@ import sys
|
|||||||
import logging
|
import logging
|
||||||
import bb
|
import bb
|
||||||
from bb import data
|
from bb import data
|
||||||
from bb.fetch import Fetch
|
from bb.fetch2 import Fetch
|
||||||
from bb.fetch import FetchError
|
from bb.fetch2 import FetchError
|
||||||
from bb.fetch import MissingParameterError
|
from bb.fetch2 import MissingParameterError
|
||||||
from bb.fetch import runfetchcmd
|
from bb.fetch2 import runfetchcmd
|
||||||
from bb.fetch import logger
|
from bb.fetch2 import logger
|
||||||
|
|
||||||
class Hg(Fetch):
|
class Hg(Fetch):
|
||||||
"""Class to fetch from mercurial repositories"""
|
"""Class to fetch from mercurial repositories"""
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ import os
|
|||||||
import bb
|
import bb
|
||||||
import bb.utils
|
import bb.utils
|
||||||
from bb import data
|
from bb import data
|
||||||
from bb.fetch import Fetch
|
from bb.fetch2 import Fetch
|
||||||
|
|
||||||
class Local(Fetch):
|
class Local(Fetch):
|
||||||
def supports(self, url, urldata, d):
|
def supports(self, url, urldata, d):
|
||||||
|
|||||||
@@ -11,10 +11,10 @@ import sys
|
|||||||
import logging
|
import logging
|
||||||
import bb
|
import bb
|
||||||
from bb import data
|
from bb import data
|
||||||
from bb.fetch import Fetch
|
from bb.fetch2 import Fetch
|
||||||
from bb.fetch import FetchError
|
from bb.fetch2 import FetchError
|
||||||
from bb.fetch import MissingParameterError
|
from bb.fetch2 import MissingParameterError
|
||||||
from bb.fetch import runfetchcmd
|
from bb.fetch2 import runfetchcmd
|
||||||
|
|
||||||
class Osc(Fetch):
|
class Osc(Fetch):
|
||||||
"""Class to fetch a module or modules from Opensuse build server
|
"""Class to fetch a module or modules from Opensuse build server
|
||||||
|
|||||||
@@ -30,9 +30,9 @@ import os
|
|||||||
import logging
|
import logging
|
||||||
import bb
|
import bb
|
||||||
from bb import data
|
from bb import data
|
||||||
from bb.fetch import Fetch
|
from bb.fetch2 import Fetch
|
||||||
from bb.fetch import FetchError
|
from bb.fetch2 import FetchError
|
||||||
from bb.fetch import logger
|
from bb.fetch2 import logger
|
||||||
|
|
||||||
class Perforce(Fetch):
|
class Perforce(Fetch):
|
||||||
def supports(self, url, ud, d):
|
def supports(self, url, ud, d):
|
||||||
|
|||||||
@@ -26,8 +26,8 @@ BitBake "Fetch" repo (git) implementation
|
|||||||
import os
|
import os
|
||||||
import bb
|
import bb
|
||||||
from bb import data
|
from bb import data
|
||||||
from bb.fetch import Fetch
|
from bb.fetch2 import Fetch
|
||||||
from bb.fetch import runfetchcmd
|
from bb.fetch2 import runfetchcmd
|
||||||
|
|
||||||
class Repo(Fetch):
|
class Repo(Fetch):
|
||||||
"""Class to fetch a module or modules from repo (git) repositories"""
|
"""Class to fetch a module or modules from repo (git) repositories"""
|
||||||
|
|||||||
@@ -38,8 +38,8 @@ IETF secsh internet draft:
|
|||||||
|
|
||||||
import re, os
|
import re, os
|
||||||
from bb import data
|
from bb import data
|
||||||
from bb.fetch import Fetch
|
from bb.fetch2 import Fetch
|
||||||
from bb.fetch import FetchError
|
from bb.fetch2 import FetchError
|
||||||
|
|
||||||
|
|
||||||
__pattern__ = re.compile(r'''
|
__pattern__ = re.compile(r'''
|
||||||
|
|||||||
@@ -29,10 +29,10 @@ import os
|
|||||||
import logging
|
import logging
|
||||||
import bb
|
import bb
|
||||||
from bb import data
|
from bb import data
|
||||||
from bb.fetch import Fetch
|
from bb.fetch2 import Fetch
|
||||||
from bb.fetch import FetchError
|
from bb.fetch2 import FetchError
|
||||||
from bb.fetch import MissingParameterError
|
from bb.fetch2 import MissingParameterError
|
||||||
from bb.fetch import logger
|
from bb.fetch2 import logger
|
||||||
|
|
||||||
class Svk(Fetch):
|
class Svk(Fetch):
|
||||||
"""Class to fetch a module or modules from svk repositories"""
|
"""Class to fetch a module or modules from svk repositories"""
|
||||||
|
|||||||
@@ -28,11 +28,11 @@ import sys
|
|||||||
import logging
|
import logging
|
||||||
import bb
|
import bb
|
||||||
from bb import data
|
from bb import data
|
||||||
from bb.fetch import Fetch
|
from bb.fetch2 import Fetch
|
||||||
from bb.fetch import FetchError
|
from bb.fetch2 import FetchError
|
||||||
from bb.fetch import MissingParameterError
|
from bb.fetch2 import MissingParameterError
|
||||||
from bb.fetch import runfetchcmd
|
from bb.fetch2 import runfetchcmd
|
||||||
from bb.fetch import logger
|
from bb.fetch2 import logger
|
||||||
|
|
||||||
class Svn(Fetch):
|
class Svn(Fetch):
|
||||||
"""Class to fetch a module or modules from svn repositories"""
|
"""Class to fetch a module or modules from svn repositories"""
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ import logging
|
|||||||
import bb
|
import bb
|
||||||
import urllib
|
import urllib
|
||||||
from bb import data
|
from bb import data
|
||||||
from bb.fetch import Fetch, FetchError, encodeurl, decodeurl, logger, runfetchcmd
|
from bb.fetch2 import Fetch, FetchError, encodeurl, decodeurl, logger, runfetchcmd
|
||||||
|
|
||||||
class Wget(Fetch):
|
class Wget(Fetch):
|
||||||
"""Class to fetch urls via 'wget'"""
|
"""Class to fetch urls via 'wget'"""
|
||||||
|
|||||||
Reference in New Issue
Block a user