diff options
Diffstat (limited to 'scripts/lib/recipetool')
-rw-r--r-- | scripts/lib/recipetool/create.py | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/scripts/lib/recipetool/create.py b/scripts/lib/recipetool/create.py index dbd118123b..63e7f0658b 100644 --- a/scripts/lib/recipetool/create.py +++ b/scripts/lib/recipetool/create.py | |||
@@ -389,9 +389,6 @@ def reformat_git_uri(uri): | |||
389 | parms.update({('protocol', 'ssh')}) | 389 | parms.update({('protocol', 'ssh')}) |
390 | elif (scheme == "http" or scheme == 'https' or scheme == 'ssh') and not ('protocol' in parms): | 390 | elif (scheme == "http" or scheme == 'https' or scheme == 'ssh') and not ('protocol' in parms): |
391 | parms.update({('protocol', scheme)}) | 391 | parms.update({('protocol', scheme)}) |
392 | # We assume 'master' branch if not set | ||
393 | if not 'branch' in parms: | ||
394 | parms.update({('branch', 'master')}) | ||
395 | # Always append 'git://' | 392 | # Always append 'git://' |
396 | fUrl = bb.fetch2.encodeurl(('git', host, path, user, pswd, parms)) | 393 | fUrl = bb.fetch2.encodeurl(('git', host, path, user, pswd, parms)) |
397 | return fUrl | 394 | return fUrl |
@@ -481,6 +478,9 @@ def create_recipe(args): | |||
481 | storeTagName = params['tag'] | 478 | storeTagName = params['tag'] |
482 | params['nobranch'] = '1' | 479 | params['nobranch'] = '1' |
483 | del params['tag'] | 480 | del params['tag'] |
481 | # Assume 'master' branch if not set | ||
482 | if scheme in ['git', 'gitsm'] and 'branch' not in params and 'nobranch' not in params: | ||
483 | params['branch'] = 'master' | ||
484 | fetchuri = bb.fetch2.encodeurl((scheme, network, path, user, passwd, params)) | 484 | fetchuri = bb.fetch2.encodeurl((scheme, network, path, user, passwd, params)) |
485 | 485 | ||
486 | tmpparent = tinfoil.config_data.getVar('BASE_WORKDIR') | 486 | tmpparent = tinfoil.config_data.getVar('BASE_WORKDIR') |
@@ -530,10 +530,9 @@ def create_recipe(args): | |||
530 | # Remove HEAD reference point and drop remote prefix | 530 | # Remove HEAD reference point and drop remote prefix |
531 | get_branch = [x.split('/', 1)[1] for x in get_branch if not x.startswith('origin/HEAD')] | 531 | get_branch = [x.split('/', 1)[1] for x in get_branch if not x.startswith('origin/HEAD')] |
532 | if 'master' in get_branch: | 532 | if 'master' in get_branch: |
533 | # If it is master, we do not need to append 'branch=master' as this is default. | ||
534 | # Even with the case where get_branch has multiple objects, if 'master' is one | 533 | # Even with the case where get_branch has multiple objects, if 'master' is one |
535 | # of them, we should default take from 'master' | 534 | # of them, we should default take from 'master' |
536 | srcbranch = '' | 535 | srcbranch = 'master' |
537 | elif len(get_branch) == 1: | 536 | elif len(get_branch) == 1: |
538 | # If 'master' isn't in get_branch and get_branch contains only ONE object, then store result into 'srcbranch' | 537 | # If 'master' isn't in get_branch and get_branch contains only ONE object, then store result into 'srcbranch' |
539 | srcbranch = get_branch[0] | 538 | srcbranch = get_branch[0] |
@@ -546,8 +545,8 @@ def create_recipe(args): | |||
546 | # Since we might have a value in srcbranch, we need to | 545 | # Since we might have a value in srcbranch, we need to |
547 | # recontruct the srcuri to include 'branch' in params. | 546 | # recontruct the srcuri to include 'branch' in params. |
548 | scheme, network, path, user, passwd, params = bb.fetch2.decodeurl(srcuri) | 547 | scheme, network, path, user, passwd, params = bb.fetch2.decodeurl(srcuri) |
549 | if srcbranch: | 548 | if scheme in ['git', 'gitsm']: |
550 | params['branch'] = srcbranch | 549 | params['branch'] = srcbranch or 'master' |
551 | 550 | ||
552 | if storeTagName and scheme in ['git', 'gitsm']: | 551 | if storeTagName and scheme in ['git', 'gitsm']: |
553 | # Check srcrev using tag and check validity of the tag | 552 | # Check srcrev using tag and check validity of the tag |
@@ -606,7 +605,7 @@ def create_recipe(args): | |||
606 | splitline = line.split() | 605 | splitline = line.split() |
607 | if len(splitline) > 1: | 606 | if len(splitline) > 1: |
608 | if splitline[0] == 'origin' and scriptutils.is_src_url(splitline[1]): | 607 | if splitline[0] == 'origin' and scriptutils.is_src_url(splitline[1]): |
609 | srcuri = reformat_git_uri(splitline[1]) | 608 | srcuri = reformat_git_uri(splitline[1]) + ';branch=master' |
610 | srcsubdir = 'git' | 609 | srcsubdir = 'git' |
611 | break | 610 | break |
612 | 611 | ||