summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/lib/recipetool/create.py16
1 files changed, 9 insertions, 7 deletions
diff --git a/scripts/lib/recipetool/create.py b/scripts/lib/recipetool/create.py
index 3abdad0fbc..40bd3c820b 100644
--- a/scripts/lib/recipetool/create.py
+++ b/scripts/lib/recipetool/create.py
@@ -656,13 +656,6 @@ def create_recipe(args):
656 else: 656 else:
657 realpv = None 657 realpv = None
658 658
659 if srcuri and not realpv or not pn:
660 name_pn, name_pv = determine_from_url(srcuri)
661 if name_pn and not pn:
662 pn = name_pn
663 if name_pv and not realpv:
664 realpv = name_pv
665
666 if not srcuri: 659 if not srcuri:
667 lines_before.append('# No information for SRC_URI yet (only an external source tree was specified)') 660 lines_before.append('# No information for SRC_URI yet (only an external source tree was specified)')
668 lines_before.append('SRC_URI = "%s"' % srcuri) 661 lines_before.append('SRC_URI = "%s"' % srcuri)
@@ -671,6 +664,7 @@ def create_recipe(args):
671 if srcuri and supports_srcrev(srcuri): 664 if srcuri and supports_srcrev(srcuri):
672 lines_before.append('') 665 lines_before.append('')
673 lines_before.append('# Modify these as desired') 666 lines_before.append('# Modify these as desired')
667 # Note: we have code to replace realpv further down if it gets set to some other value
674 lines_before.append('PV = "%s+git${SRCPV}"' % (realpv or '1.0')) 668 lines_before.append('PV = "%s+git${SRCPV}"' % (realpv or '1.0'))
675 pv_srcpv = True 669 pv_srcpv = True
676 if not args.autorev and srcrev == '${AUTOREV}': 670 if not args.autorev and srcrev == '${AUTOREV}':
@@ -750,6 +744,13 @@ def create_recipe(args):
750 if '_' in pn: 744 if '_' in pn:
751 pn = pn.replace('_', '-') 745 pn = pn.replace('_', '-')
752 746
747 if srcuri and not realpv or not pn:
748 name_pn, name_pv = determine_from_url(srcuri)
749 if name_pn and not pn:
750 pn = name_pn
751 if name_pv and not realpv:
752 realpv = name_pv
753
753 if not outfile: 754 if not outfile:
754 if not pn: 755 if not pn:
755 log_error_cond('Unable to determine short program name from source tree - please specify name with -N/--name or output file name with -o/--outfile', args.devtool) 756 log_error_cond('Unable to determine short program name from source tree - please specify name with -N/--name or output file name with -o/--outfile', args.devtool)
@@ -803,6 +804,7 @@ def create_recipe(args):
803 line = line.replace(realpv, '${PV}') 804 line = line.replace(realpv, '${PV}')
804 elif line.startswith('PV = '): 805 elif line.startswith('PV = '):
805 if realpv: 806 if realpv:
807 # Replace the first part of the PV value
806 line = re.sub('"[^+]*\+', '"%s+' % realpv, line) 808 line = re.sub('"[^+]*\+', '"%s+' % realpv, line)
807 lines_before.append(line) 809 lines_before.append(line)
808 810