diff options
Diffstat (limited to 'scripts/lib/recipetool/create.py')
-rw-r--r-- | scripts/lib/recipetool/create.py | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/scripts/lib/recipetool/create.py b/scripts/lib/recipetool/create.py index 566c75369a..a2c6d052a6 100644 --- a/scripts/lib/recipetool/create.py +++ b/scripts/lib/recipetool/create.py | |||
@@ -435,7 +435,7 @@ def create_recipe(args): | |||
435 | if args.binary: | 435 | if args.binary: |
436 | # Assume the archive contains the directory structure verbatim | 436 | # Assume the archive contains the directory structure verbatim |
437 | # so we need to extract to a subdirectory | 437 | # so we need to extract to a subdirectory |
438 | fetchuri += ';subdir=${BP}' | 438 | fetchuri += ';subdir=${BPN}' |
439 | srcuri = fetchuri | 439 | srcuri = fetchuri |
440 | rev_re = re.compile(';rev=([^;]+)') | 440 | rev_re = re.compile(';rev=([^;]+)') |
441 | res = rev_re.search(srcuri) | 441 | res = rev_re.search(srcuri) |
@@ -478,6 +478,9 @@ def create_recipe(args): | |||
478 | storeTagName = params['tag'] | 478 | storeTagName = params['tag'] |
479 | params['nobranch'] = '1' | 479 | params['nobranch'] = '1' |
480 | 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' | ||
481 | fetchuri = bb.fetch2.encodeurl((scheme, network, path, user, passwd, params)) | 484 | fetchuri = bb.fetch2.encodeurl((scheme, network, path, user, passwd, params)) |
482 | 485 | ||
483 | tmpparent = tinfoil.config_data.getVar('BASE_WORKDIR') | 486 | tmpparent = tinfoil.config_data.getVar('BASE_WORKDIR') |
@@ -527,10 +530,9 @@ def create_recipe(args): | |||
527 | # Remove HEAD reference point and drop remote prefix | 530 | # Remove HEAD reference point and drop remote prefix |
528 | 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')] |
529 | if 'master' in get_branch: | 532 | if 'master' in get_branch: |
530 | # If it is master, we do not need to append 'branch=master' as this is default. | ||
531 | # 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 |
532 | # of them, we should default take from 'master' | 534 | # of them, we should default take from 'master' |
533 | srcbranch = '' | 535 | srcbranch = 'master' |
534 | elif len(get_branch) == 1: | 536 | elif len(get_branch) == 1: |
535 | # 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' |
536 | srcbranch = get_branch[0] | 538 | srcbranch = get_branch[0] |
@@ -543,8 +545,8 @@ def create_recipe(args): | |||
543 | # Since we might have a value in srcbranch, we need to | 545 | # Since we might have a value in srcbranch, we need to |
544 | # recontruct the srcuri to include 'branch' in params. | 546 | # recontruct the srcuri to include 'branch' in params. |
545 | scheme, network, path, user, passwd, params = bb.fetch2.decodeurl(srcuri) | 547 | scheme, network, path, user, passwd, params = bb.fetch2.decodeurl(srcuri) |
546 | if srcbranch: | 548 | if scheme in ['git', 'gitsm']: |
547 | params['branch'] = srcbranch | 549 | params['branch'] = srcbranch or 'master' |
548 | 550 | ||
549 | if storeTagName and scheme in ['git', 'gitsm']: | 551 | if storeTagName and scheme in ['git', 'gitsm']: |
550 | # Check srcrev using tag and check validity of the tag | 552 | # Check srcrev using tag and check validity of the tag |
@@ -603,7 +605,7 @@ def create_recipe(args): | |||
603 | splitline = line.split() | 605 | splitline = line.split() |
604 | if len(splitline) > 1: | 606 | if len(splitline) > 1: |
605 | if splitline[0] == 'origin' and scriptutils.is_src_url(splitline[1]): | 607 | if splitline[0] == 'origin' and scriptutils.is_src_url(splitline[1]): |
606 | srcuri = reformat_git_uri(splitline[1]) | 608 | srcuri = reformat_git_uri(splitline[1]) + ';branch=master' |
607 | srcsubdir = 'git' | 609 | srcsubdir = 'git' |
608 | break | 610 | break |
609 | 611 | ||
@@ -743,6 +745,10 @@ def create_recipe(args): | |||
743 | for handler in handlers: | 745 | for handler in handlers: |
744 | handler.process(srctree_use, classes, lines_before, lines_after, handled, extravalues) | 746 | handler.process(srctree_use, classes, lines_before, lines_after, handled, extravalues) |
745 | 747 | ||
748 | # native and nativesdk classes are special and must be inherited last | ||
749 | # If present, put them at the end of the classes list | ||
750 | classes.sort(key=lambda c: c in ("native", "nativesdk")) | ||
751 | |||
746 | extrafiles = extravalues.pop('extrafiles', {}) | 752 | extrafiles = extravalues.pop('extrafiles', {}) |
747 | extra_pn = extravalues.pop('PN', None) | 753 | extra_pn = extravalues.pop('PN', None) |
748 | extra_pv = extravalues.pop('PV', None) | 754 | extra_pv = extravalues.pop('PV', None) |