]> code.ossystems Code Review - openembedded-core.git/commitdiff
bb.fetch2: replace bb.fetch with bb.fetch2 in the bb.fetch
authorYu Ke <ke.yu@intel.com>
Mon, 10 Jan 2011 18:05:07 +0000 (18:05 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 10 Jan 2011 18:05:07 +0000 (18:05 +0000)
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>
13 files changed:
bitbake/lib/bb/fetch2/__init__.py
bitbake/lib/bb/fetch2/bzr.py
bitbake/lib/bb/fetch2/cvs.py
bitbake/lib/bb/fetch2/git.py
bitbake/lib/bb/fetch2/hg.py
bitbake/lib/bb/fetch2/local.py
bitbake/lib/bb/fetch2/osc.py
bitbake/lib/bb/fetch2/perforce.py
bitbake/lib/bb/fetch2/repo.py
bitbake/lib/bb/fetch2/ssh.py
bitbake/lib/bb/fetch2/svk.py
bitbake/lib/bb/fetch2/svn.py
bitbake/lib/bb/fetch2/wget.py

index f7153ebce966d9acd245e12f04499946aa43ad5e..dd6f714d712389495069fef533c83e199332b58f 100644 (file)
@@ -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])
                 if uri_find_decoded.index(i) == 2:
                     if d:
-                        localfn = bb.fetch.localpath(uri, d)
+                        localfn = bb.fetch2.localpath(uri, d)
                         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:
                 return uri
     return encodeurl(result_decoded)
@@ -158,7 +158,7 @@ def fetcher_init(d):
     elif srcrev_policy == "clear":
         logger.debug(1, "Clearing SRCREV cache due to cache policy of: %s", srcrev_policy)
         try:
-            bb.fetch.saved_headrevs = pd['BB_URI_HEADREVS'].items()
+            bb.fetch2.saved_headrevs = pd['BB_URI_HEADREVS'].items()
         except:
             pass
         del pd['BB_URI_HEADREVS']
@@ -177,7 +177,7 @@ def fetcher_compare_revisions(d):
 
     pd = persist_data.persist(d)
     data = pd['BB_URI_HEADREVS'].items()
-    data2 = bb.fetch.saved_headrevs
+    data2 = bb.fetch2.saved_headrevs
 
     changed = False
     for key in data:
@@ -378,7 +378,7 @@ def get_srcrev(d):
     #
     # Neater solutions welcome!
     #
-    if bb.fetch.srcrev_internal_call:
+    if bb.fetch2.srcrev_internal_call:
         return "SRCREVINACTION"
 
     scms = []
@@ -494,7 +494,7 @@ def try_mirrors(d, uri, mirrors, check = False, force = False):
         if newuri != uri:
             try:
                 ud = FetchData(newuri, ld)
-            except bb.fetch.NoMethodError:
+            except bb.fetch2.NoMethodError:
                 logger.debug(1, "No method for %s", uri)
                 continue
 
@@ -508,9 +508,9 @@ def try_mirrors(d, uri, mirrors, check = False, force = False):
                 else:
                     ud.method.go(newuri, ud, ld)
                     return ud.localpath
-            except (bb.fetch.MissingParameterError,
-                    bb.fetch.FetchError,
-                    bb.fetch.MD5SumError):
+            except (bb.fetch2.MissingParameterError,
+                    bb.fetch2.FetchError,
+                    bb.fetch2.MD5SumError):
                 import sys
                 (type, value, traceback) = sys.exc_info()
                 logger.debug(2, "Mirror fetch failure: %s", value)
@@ -571,10 +571,10 @@ class FetchData(object):
                 self.localpath = local
             if not local:
                 try:
-                    bb.fetch.srcrev_internal_call = True
+                    bb.fetch2.srcrev_internal_call = True
                     self.localpath = self.method.localpath(self.url, self, d)
                 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.
                 # Horrible...
                 bb.data.delVar("ISHOULDNEVEREXIST", d)
index afaf799900cbd29413d08edf49ba0a74a6e17d5e..3d23b4d3cfcc9204ad713909b9fa6533d46bce07 100644 (file)
@@ -28,7 +28,7 @@ import sys
 import logging
 import bb
 from bb import data
-from bb.fetch import Fetch, FetchError, runfetchcmd, logger
+from bb.fetch2 import Fetch, FetchError, runfetchcmd, logger
 
 class Bzr(Fetch):
     def supports(self, url, ud, d):
index 0edb794b044787f3f1e19a3522392f2c41b46237..1570cab9c3b4d1ebd186a5372b502c9259f6e350 100644 (file)
@@ -30,7 +30,7 @@ import os
 import logging
 import bb
 from   bb import data
-from bb.fetch import Fetch, FetchError, MissingParameterError, logger
+from bb.fetch2 import Fetch, FetchError, MissingParameterError, logger
 
 class Cvs(Fetch):
     """
index de415ec309a9077de0e52b728010290b2d96641a..e8ad3b43ca41acbf1479c0f7ad3cb5b860cccf06 100644 (file)
@@ -23,9 +23,9 @@ BitBake 'Fetch' git implementation
 import os
 import bb
 from   bb    import data
-from   bb.fetch import Fetch
-from   bb.fetch import runfetchcmd
-from   bb.fetch import logger
+from   bb.fetch2 import Fetch
+from   bb.fetch2 import runfetchcmd
+from   bb.fetch2 import logger
 
 class Git(Fetch):
     """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)
         output = runfetchcmd(cmd, d, True)
         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]
 
     def _build_revision(self, url, ud, d):
index 3c649a6ad0c9d0f35dd8648d3e6840bf12525679..9e91bec1861ae81b12d5e8f378a55a55531d67a9 100644 (file)
@@ -29,11 +29,11 @@ import sys
 import logging
 import bb
 from bb import data
-from bb.fetch import Fetch
-from bb.fetch import FetchError
-from bb.fetch import MissingParameterError
-from bb.fetch import runfetchcmd
-from bb.fetch import logger
+from bb.fetch2 import Fetch
+from bb.fetch2 import FetchError
+from bb.fetch2 import MissingParameterError
+from bb.fetch2 import runfetchcmd
+from bb.fetch2 import logger
 
 class Hg(Fetch):
     """Class to fetch from mercurial repositories"""
index 6aa9e4576887ab5338aa2fbfb749d6a44df81591..bcb30dfc95b91e2fc05a38dac0d7c4a584d0ebcf 100644 (file)
@@ -29,7 +29,7 @@ import os
 import bb
 import bb.utils
 from   bb import data
-from   bb.fetch import Fetch
+from   bb.fetch2 import Fetch
 
 class Local(Fetch):
     def supports(self, url, urldata, d):
index 26820967a3549c4769635bfee0f332b0036b41a1..06ac5a9ce374da558ccb3a5abd315ecf1a7f1ebe 100644 (file)
@@ -11,10 +11,10 @@ import  sys
 import logging
 import  bb
 from    bb       import data
-from    bb.fetch import Fetch
-from    bb.fetch import FetchError
-from    bb.fetch import MissingParameterError
-from    bb.fetch import runfetchcmd
+from    bb.fetch2 import Fetch
+from    bb.fetch2 import FetchError
+from    bb.fetch2 import MissingParameterError
+from    bb.fetch2 import runfetchcmd
 
 class Osc(Fetch):
     """Class to fetch a module or modules from Opensuse build server
index 222ed7eaaa8cb16f6c9b9daf8eafd260d623be9e..18b27812e002d9209005a22904a9588743d0cce6 100644 (file)
@@ -30,9 +30,9 @@ import os
 import logging
 import bb
 from   bb import data
-from   bb.fetch import Fetch
-from   bb.fetch import FetchError
-from   bb.fetch import logger
+from   bb.fetch2 import Fetch
+from   bb.fetch2 import FetchError
+from   bb.fetch2 import logger
 
 class Perforce(Fetch):
     def supports(self, url, ud, d):
index 03642e7a0d2a13e37ab4de6015f9b172cf414434..3330957ce342a8c3d3471e16f4dfe458401a8585 100644 (file)
@@ -26,8 +26,8 @@ BitBake "Fetch" repo (git) implementation
 import os
 import bb
 from   bb    import data
-from   bb.fetch import Fetch
-from   bb.fetch import runfetchcmd
+from   bb.fetch2 import Fetch
+from   bb.fetch2 import runfetchcmd
 
 class Repo(Fetch):
     """Class to fetch a module or modules from repo (git) repositories"""
index 86c76f4e44cbd106707d07e10506ffb46f070871..8b283222bf403f88c52b2246dbbcfaf47c9e7538 100644 (file)
@@ -38,8 +38,8 @@ IETF secsh internet draft:
 
 import re, os
 from   bb import data
-from   bb.fetch import Fetch
-from   bb.fetch import FetchError
+from   bb.fetch2 import Fetch
+from   bb.fetch2 import FetchError
 
 
 __pattern__ = re.compile(r'''
index 595a9da25518ca760a9a0e28789e9021210fddcb..7990ff21fa947298cf6d20a2172127036b24cf12 100644 (file)
@@ -29,10 +29,10 @@ import os
 import logging
 import bb
 from   bb import data
-from   bb.fetch import Fetch
-from   bb.fetch import FetchError
-from   bb.fetch import MissingParameterError
-from   bb.fetch import logger
+from   bb.fetch2 import Fetch
+from   bb.fetch2 import FetchError
+from   bb.fetch2 import MissingParameterError
+from   bb.fetch2 import logger
 
 class Svk(Fetch):
     """Class to fetch a module or modules from svk repositories"""
index 8f053abf74b7e101227b46b9b8760a77a955e2d5..3315b159da242e595015a3b66f7bc0f1214d7faa 100644 (file)
@@ -28,11 +28,11 @@ import sys
 import logging
 import bb
 from   bb import data
-from   bb.fetch import Fetch
-from   bb.fetch import FetchError
-from   bb.fetch import MissingParameterError
-from   bb.fetch import runfetchcmd
-from   bb.fetch import logger
+from   bb.fetch2 import Fetch
+from   bb.fetch2 import FetchError
+from   bb.fetch2 import MissingParameterError
+from   bb.fetch2 import runfetchcmd
+from   bb.fetch2 import logger
 
 class Svn(Fetch):
     """Class to fetch a module or modules from svn repositories"""
index 4d4bdfd493ad50318162e06cc35c852bee436608..cf36ccad0aac08379db7df52b926404656be9ac6 100644 (file)
@@ -30,7 +30,7 @@ import logging
 import bb
 import urllib
 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 to fetch urls via 'wget'"""