* [PATCH 0/2] Minor recipetool create fixes
@ 2017-05-14 21:59 Paul Eggleton
2017-05-14 21:59 ` [PATCH 1/2] recipetool: create: skip values extracted from spec files containing macros Paul Eggleton
2017-05-14 21:59 ` [PATCH 2/2] recipetool: create: extract name of package from a repository Paul Eggleton
0 siblings, 2 replies; 3+ messages in thread
From: Paul Eggleton @ 2017-05-14 21:59 UTC (permalink / raw)
To: openembedded-core
The following changes since commit c59fa3bd71b42410bf032846ee8fdb6e6eb1b95c:
python*-git: Upgrade to version 2.1.3 (2017-05-12 08:49:30 +0100)
are available in the git repository at:
git://git.openembedded.org/openembedded-core-contrib paule/recipetool-fixes8
http://cgit.openembedded.org/openembedded-core-contrib/log/?h=paule/recipetool-fixes8
Paul Eggleton (2):
recipetool: create: skip values extracted from spec files containing macros
recipetool: create: extract name of package from a repository
scripts/lib/recipetool/create.py | 11 ++++++++---
scripts/lib/recipetool/create_buildsys.py | 4 ++++
2 files changed, 12 insertions(+), 3 deletions(-)
--
2.9.3
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 1/2] recipetool: create: skip values extracted from spec files containing macros
2017-05-14 21:59 [PATCH 0/2] Minor recipetool create fixes Paul Eggleton
@ 2017-05-14 21:59 ` Paul Eggleton
2017-05-14 21:59 ` [PATCH 2/2] recipetool: create: extract name of package from a repository Paul Eggleton
1 sibling, 0 replies; 3+ messages in thread
From: Paul Eggleton @ 2017-05-14 21:59 UTC (permalink / raw)
To: openembedded-core
If a value we extract from a spec file contains an unexpanded macro
(e.g. %{macroname}) then we should discard it since we're not seeing the
actual value and we don't have an easy way of expanding it at the
moment.
This fixes for example getting %{name} as the recipe name when running
the following:
recipetool create https://github.com/gavincarr/mod_auth_tkt.git
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
scripts/lib/recipetool/create_buildsys.py | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/scripts/lib/recipetool/create_buildsys.py b/scripts/lib/recipetool/create_buildsys.py
index e914e53..4743c74 100644
--- a/scripts/lib/recipetool/create_buildsys.py
+++ b/scripts/lib/recipetool/create_buildsys.py
@@ -863,6 +863,10 @@ class SpecFileRecipeHandler(RecipeHandler):
break
if len(foundvalues) == len(valuemap):
break
+ # Drop values containing unexpanded RPM macros
+ for k in list(foundvalues.keys()):
+ if '%' in foundvalues[k]:
+ del foundvalues[k]
if 'PV' in foundvalues:
if not validate_pv(foundvalues['PV']):
del foundvalues['PV']
--
2.9.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 2/2] recipetool: create: extract name of package from a repository
2017-05-14 21:59 [PATCH 0/2] Minor recipetool create fixes Paul Eggleton
2017-05-14 21:59 ` [PATCH 1/2] recipetool: create: skip values extracted from spec files containing macros Paul Eggleton
@ 2017-05-14 21:59 ` Paul Eggleton
1 sibling, 0 replies; 3+ messages in thread
From: Paul Eggleton @ 2017-05-14 21:59 UTC (permalink / raw)
To: openembedded-core
For git repositories in the absence of any other indicator, it's not an
unreasonable assumption that the name of the repository is the name of
the software package it contains, so use that as PN if we don't have
anything else.
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
scripts/lib/recipetool/create.py | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/scripts/lib/recipetool/create.py b/scripts/lib/recipetool/create.py
index 5af58a1..2a5a84c 100644
--- a/scripts/lib/recipetool/create.py
+++ b/scripts/lib/recipetool/create.py
@@ -339,9 +339,14 @@ def determine_from_url(srcuri):
pn = res.group(1).strip().replace('_', '-')
pv = res.group(2).strip().replace('_', '.')
- if not pn and not pv and parseres.scheme not in ['git', 'gitsm', 'svn', 'hg']:
- srcfile = os.path.basename(parseres.path.rstrip('/'))
- pn, pv = determine_from_filename(srcfile)
+ if not pn and not pv:
+ if parseres.scheme not in ['git', 'gitsm', 'svn', 'hg']:
+ srcfile = os.path.basename(parseres.path.rstrip('/'))
+ pn, pv = determine_from_filename(srcfile)
+ elif parseres.scheme in ['git', 'gitsm']:
+ pn = os.path.basename(parseres.path.rstrip('/')).lower().replace('_', '-')
+ if pn.endswith('.git'):
+ pn = pn[:-4]
logger.debug('Determined from source URL: name = "%s", version = "%s"' % (pn, pv))
return (pn, pv)
--
2.9.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-05-14 22:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-14 21:59 [PATCH 0/2] Minor recipetool create fixes Paul Eggleton
2017-05-14 21:59 ` [PATCH 1/2] recipetool: create: skip values extracted from spec files containing macros Paul Eggleton
2017-05-14 21:59 ` [PATCH 2/2] recipetool: create: extract name of package from a repository Paul Eggleton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox