diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2017-08-21 17:39:48 +1200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-08-21 08:30:32 +0100 |
commit | 3bb979c13463705c4db6c59034661c4cd8100756 (patch) | |
tree | 1301df59ab746f88449ed66bdd2c0808ccbe699b /scripts | |
parent | 2de8ba89ef10fefcc97246dfeb4b8d1e48ee8232 (diff) | |
download | openembedded-core-3bb979c13463705c4db6c59034661c4cd8100756.tar.gz openembedded-core-3bb979c13463705c4db6c59034661c4cd8100756.tar.bz2 openembedded-core-3bb979c13463705c4db6c59034661c4cd8100756.zip |
recipetool: allow plugins to set PN / PV more easily
Previously if we were able to auto-determine the name from the URL, that
took precedence over any name that might be set in extravalues by a
plugin. Some plugins might be able to get a better idea of the name and
thus we should move defaulting of the name further down after the
plugins have had a chance to set it.
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/lib/recipetool/create.py | 16 |
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): else: realpv = None - if srcuri and not realpv or not pn: - name_pn, name_pv = determine_from_url(srcuri) - if name_pn and not pn: - pn = name_pn - if name_pv and not realpv: - realpv = name_pv - if not srcuri: lines_before.append('# No information for SRC_URI yet (only an external source tree was specified)') lines_before.append('SRC_URI = "%s"' % srcuri) @@ -671,6 +664,7 @@ def create_recipe(args): if srcuri and supports_srcrev(srcuri): lines_before.append('') lines_before.append('# Modify these as desired') + # Note: we have code to replace realpv further down if it gets set to some other value lines_before.append('PV = "%s+git${SRCPV}"' % (realpv or '1.0')) pv_srcpv = True if not args.autorev and srcrev == '${AUTOREV}': @@ -750,6 +744,13 @@ def create_recipe(args): if '_' in pn: pn = pn.replace('_', '-') + if srcuri and not realpv or not pn: + name_pn, name_pv = determine_from_url(srcuri) + if name_pn and not pn: + pn = name_pn + if name_pv and not realpv: + realpv = name_pv + if not outfile: if not pn: 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): line = line.replace(realpv, '${PV}') elif line.startswith('PV = '): if realpv: + # Replace the first part of the PV value line = re.sub('"[^+]*\+', '"%s+' % realpv, line) lines_before.append(line) |