[oe-commits] [openembedded-core] 25/31: recipetool: create: fix handling of github URLs

git at git.openembedded.org git at git.openembedded.org
Tue Jul 12 22:11:36 UTC 2016


rpurdie pushed a commit to branch master
in repository openembedded-core.

commit 7998dc3597657229507e5c140fceef1e485ac402
Author: Paul Eggleton <paul.eggleton at linux.intel.com>
AuthorDate: Thu Jul 7 11:57:07 2016 +1200

    recipetool: create: fix handling of github URLs
    
    For a while now, Github hasn't been advertising a specific repository
    URL since cloning the web URL with git works. Armed with this knowledge
    and fully expecting people to just paste the github URL, we need to
    handle this situation specially. If it looks like a github URL to the
    root of a repository then treat it as a git repository instead of a
    normal https URL to be fetched by the wget fetcher.
    
    Signed-off-by: Paul Eggleton <paul.eggleton at linux.intel.com>
    Signed-off-by: Ross Burton <ross.burton at intel.com>
---
 scripts/lib/recipetool/create.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/lib/recipetool/create.py b/scripts/lib/recipetool/create.py
index 430f5bb..95b16fb 100644
--- a/scripts/lib/recipetool/create.py
+++ b/scripts/lib/recipetool/create.py
@@ -324,7 +324,7 @@ def supports_srcrev(uri):
 def reformat_git_uri(uri):
     '''Convert any http[s]://....git URI into git://...;protocol=http[s]'''
     checkuri = uri.split(';', 1)[0]
-    if checkuri.endswith('.git') or '/git/' in checkuri:
+    if checkuri.endswith('.git') or '/git/' in checkuri or re.match('https?://github.com/[^/]+/[^/]+/?', checkuri):
         res = re.match('(https?)://([^;]+(\.git)?)(;.*)?$', uri)
         if res:
             # Need to switch the URI around so that the git fetcher is used

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list