]> code.ossystems Code Review - openembedded-core.git/commitdiff
bitbake: Sync with bitbake 1.8 branch
authorRichard Purdie <richard@openedhand.com>
Sun, 27 Apr 2008 11:22:54 +0000 (11:22 +0000)
committerRichard Purdie <richard@openedhand.com>
Sun, 27 Apr 2008 11:22:54 +0000 (11:22 +0000)
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@4352 311d38ba-8fff-0310-9ca6-ca027cbcb966

bitbake/ChangeLog
bitbake/lib/bb/fetch/__init__.py
bitbake/lib/bb/fetch/cvs.py
bitbake/lib/bb/fetch/local.py
bitbake/lib/bb/fetch/wget.py

index 7bed88112e35d79373eb5fc3b34b43af2ae7cd22..871f260c48fec0b16cb437abf1cfaa90b3b245a0 100644 (file)
@@ -26,6 +26,10 @@ Changes in BitBake 1.8.x:
          failed where needed. Fixes --continue mode crashes.
        - Fix problems with recrdeptask handling where some idepends weren't handled
          correctly.
+       - Work around refs/HEAD issues with git over http (#3410)
+       - Add proxy support to the CVS fetcher (from Cyril Chemparathy)
+       - Improve runfetchcmd so errors are seen and various GIT variables are exported
+       - Add ability to fetchers to check URL validity without downloading
 
 Changes in BitBake 1.8.10:
        - Psyco is available only for x86 - do not use it on other architectures.
index 41eebb29b5b27dccc7fe1ac61ca9984c83c4d1c7..c697f4744ff60f6e0e83a66eec5aa204e55524fa 100644 (file)
@@ -162,6 +162,22 @@ def go(d):
                 Fetch.write_md5sum(u, ud, d)
             bb.utils.unlockfile(lf)
 
+
+def checkstatus(d):
+    """
+    Check all urls exist upstream
+    init must have previously been called
+    """
+    urldata = init([], d, True)
+
+    for u in urldata:
+        ud = urldata[u]
+        m = ud.method
+        bb.msg.note(1, bb.msg.domain.Fetcher, "Testing URL %s" % u)
+        ret = m.checkstatus(u, ud, d)
+        if not ret:
+            bb.msg.fatal(bb.msg.domain.Fetcher, "URL %s doesn't work" % u)
+
 def localpaths(d):
     """
     Return a list of the local filenames, assuming successful fetch
@@ -364,6 +380,14 @@ class Fetch(object):
         """
         raise NoMethodError("Missing implementation for url")
 
+    def checkstatus(self, url, urldata, d):
+        """
+        Check the status of a URL
+        Assumes localpath was called first
+        """
+        bb.msg.note(1, bb.msg.domain.Fetcher, "URL %s could not be checked for status since no method exists." % url)
+        return True
+
     def getSRCDate(urldata, d):
         """
         Return the SRC Date for the component
index 01acc3f7858eb0f15dfeeeee2b69708eff109701..c4ccf4303f1930849670347454f4dcb55f23887e 100644 (file)
@@ -118,7 +118,7 @@ class Cvs(Fetch):
         if 'norecurse' in ud.parm:
             options.append("-l")
         if ud.date:
-            options.append("-D %s" % ud.date)
+            options.append("-D \"%s UTC\"" % ud.date)
         if ud.tag:
             options.append("-r %s" % ud.tag)
 
index 5e480a208e0499acd94fc74c78d30366df75bef4..a39cdce22fcfa47a05e887e0d01c8e6917e967a8 100644 (file)
@@ -59,3 +59,11 @@ class Local(Fetch):
         """Fetch urls (no-op for Local method)"""
         # no need to fetch local files, we'll deal with them in place.
         return 1
+
+    def checkstatus(self, url, urldata, d):
+        """
+        Check the status of the url
+        """
+        if os.path.exists(urldata.localpath):
+           return True
+        return False
index f8ade45da74e3be5c660e28a36c551237b8735ce..a5979dead86d0ce04c59ff657f5b186713cb24f1 100644 (file)
@@ -48,11 +48,13 @@ class Wget(Fetch):
 
         return os.path.join(data.getVar("DL_DIR", d, True), ud.localfile)
 
-    def go(self, uri, ud, d):
+    def go(self, uri, ud, d, checkonly = False):
         """Fetch urls"""
 
         def fetch_uri(uri, ud, d):
-            if os.path.exists(ud.localpath):
+            if checkonly:
+                fetchcmd = data.getVar("FETCHCOMMAND", d, 1) + " " + data.getVar("FETCHOPTION_checkonly", d, 1)
+            elif os.path.exists(ud.localpath):
                 # file exists, but we didnt complete it.. trying again..
                 fetchcmd = data.getVar("RESUMECOMMAND", d, 1)
             else:
@@ -83,10 +85,10 @@ class Wget(Fetch):
             newuri = uri_replace(uri, find, replace, d)
             if newuri != uri:
                 if fetch_uri(newuri, ud, localdata):
-                    return
+                    return True
 
         if fetch_uri(uri, ud, localdata):
-            return
+            return True
 
         # try mirrors
         mirrors = [ i.split() for i in (data.getVar('MIRRORS', localdata, 1) or "").split('\n') if i ]
@@ -94,6 +96,10 @@ class Wget(Fetch):
             newuri = uri_replace(uri, find, replace, d)
             if newuri != uri:
                 if fetch_uri(newuri, ud, localdata):
-                    return
+                    return True
 
         raise FetchError(uri)
+
+
+    def checkstatus(self, uri, ud, d):
+        return self.go(uri, ud, d, True)