* [PATCH] recipetool: create: handle git URLs specifying only a tag
@ 2017-07-20 3:26 Stanley Phoong
2017-07-20 3:26 ` Stanley Phoong
2017-07-20 3:31 ` ✗ patchtest: failure for " Patchwork
0 siblings, 2 replies; 3+ messages in thread
From: Stanley Phoong @ 2017-07-20 3:26 UTC (permalink / raw)
To: OpenEmbedded Core Mailing List
This patch depends on Rebecca's patch on Bug #11389. Her patch has already
been submitted into the mailing list.
lists.openembedded.org/pipermail/openembedded-core/2017-July/139574.html
Please patch mine together with her patch.
Stanley Phoong (1):
recipetool: create: handle git URLs specifying only a tag
scripts/lib/recipetool/create.py | 27 ++++++++++++++++++++++++++-
1 file changed, 26 insertions(+), 1 deletion(-)
--
2.7.4
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] recipetool: create: handle git URLs specifying only a tag
2017-07-20 3:26 [PATCH] recipetool: create: handle git URLs specifying only a tag Stanley Phoong
@ 2017-07-20 3:26 ` Stanley Phoong
2017-07-20 3:31 ` ✗ patchtest: failure for " Patchwork
1 sibling, 0 replies; 3+ messages in thread
From: Stanley Phoong @ 2017-07-20 3:26 UTC (permalink / raw)
To: OpenEmbedded Core Mailing List
If a git URL is passed to recipetool create with a tag=, recipetool
should handle it assuming that the tag is valid. Also, during the
creation of recipe, it seems that the automation for replacing
${PV} at the SRCURI for tag, (e.g mbed-tls-${PV}) is causing some
issue due to PV assuming it's a git source. A fix is implemented in
this patch as a workaround for this issue. This fix will be submitted
in a separate patch as a separate issue.
[YOCTO #11393]
Signed-off-by: Stanley Phoong <stanley.cheong.kwan.phoong@intel.com>
---
scripts/lib/recipetool/create.py | 27 ++++++++++++++++++++++++++-
1 file changed, 26 insertions(+), 1 deletion(-)
diff --git a/scripts/lib/recipetool/create.py b/scripts/lib/recipetool/create.py
index a45b90d..0619428 100644
--- a/scripts/lib/recipetool/create.py
+++ b/scripts/lib/recipetool/create.py
@@ -434,6 +434,18 @@ def create_recipe(args):
# 2. User did not set 'nobranch=1' in srcuri, and
# 3. Source revision is not '${AUTOREV}'
fetchuri = fetchuri + ';nobranch=1'
+ # Create an empty storeTagName to ensure the checkers do not point to a null variable
+ storeTagName = ''
+ tag_re = re.compile(';tag=([^;]+)')
+ tag = tag_re.search(fetchuri)
+ if tag:
+ scheme, host, path, user, pswd, parms = bb.fetch2.decodeurl(fetchuri)
+ # Keep a copy of tag and append nobranch=1 then remove tag from URL,
+ # Will re-introduce tag argument after bitbake fetcher process is complete.
+ storeTagName = parms['tag']
+ parms.update({('nobranch', '1')})
+ del parms['tag']
+ fetchuri = bb.fetch2.encodeurl((scheme, host, path, user, pswd, parms))
tempsrc = tempfile.mkdtemp(prefix='recipetool-')
srctree = tempsrc
d = bb.data.createCopy(tinfoil.config_data)
@@ -488,6 +500,17 @@ def create_recipe(args):
mbrch = '\n ' + '\n '.join(get_branch)
logger.error('Revision %s was found on multiple branches: %s\nPlease provide the correct branch in the source URL with ;branch=<branch> (and ensure you use quotes around the URL to avoid the shell interpreting the ";")' % (srcrev, mbrch))
sys.exit(1)
+ if storeTagName:
+ # Re-introduced tag variable from storeTagName
+ # Check srcrev using tag and check validity of the tag
+ try:
+ cmd = ('git rev-list -n 1 %s' % (storeTagName))
+ check_tag, check_tag_err = bb.process.run('%s' % cmd, cwd=srctree)
+ srcrev = check_tag.split()[0]
+ except bb.process.ExecutionError as err:
+ logger.error(str(err))
+ logger.error("Possibly wrong tag name is provided")
+ sys.exit(1)
if os.path.exists(os.path.join(srctree, '.gitmodules')) and srcuri.startswith('git://'):
srcuri = 'gitsm://' + srcuri[6:]
logger.info('Fetching submodules...')
@@ -628,10 +651,12 @@ def create_recipe(args):
lines_before.append('SRC_URI[md5sum] = "%s"' % md5value)
if sha256value:
lines_before.append('SRC_URI[sha256sum] = "%s"' % sha256value)
+ pv_srcpv = False
if srcuri and supports_srcrev(srcuri):
lines_before.append('')
lines_before.append('# Modify these as desired')
lines_before.append('PV = "%s+git${SRCPV}"' % (realpv or '1.0'))
+ pv_srcpv = True
if not args.autorev and srcrev == '${AUTOREV}':
if os.path.exists(os.path.join(srctree, '.git')):
(stdout, _) = bb.process.run('git rev-parse HEAD', cwd=srctree)
@@ -758,7 +783,7 @@ def create_recipe(args):
skipblank = True
continue
elif line.startswith('SRC_URI = '):
- if realpv:
+ if realpv and not pv_srcpv:
line = line.replace(realpv, '${PV}')
elif line.startswith('PV = '):
if realpv:
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* ✗ patchtest: failure for recipetool: create: handle git URLs specifying only a tag
2017-07-20 3:26 [PATCH] recipetool: create: handle git URLs specifying only a tag Stanley Phoong
2017-07-20 3:26 ` Stanley Phoong
@ 2017-07-20 3:31 ` Patchwork
1 sibling, 0 replies; 3+ messages in thread
From: Patchwork @ 2017-07-20 3:31 UTC (permalink / raw)
To: Phoong Stanley Cheong Kwan; +Cc: openembedded-core
== Series Details ==
Series: recipetool: create: handle git URLs specifying only a tag
Revision: 1
URL : https://patchwork.openembedded.org/series/7824/
State : failure
== Summary ==
Thank you for submitting this patch series to OpenEmbedded Core. This is
an automated response. Several tests have been executed on the proposed
series by patchtest resulting in the following failures:
* Issue Series does not apply on top of target branch [test_series_merge_on_head]
Suggested fix Rebase your series on top of targeted branch
Targeted branch master (currently at c4c2fb3732)
If you believe any of these test results are incorrect, please reply to the
mailing list (openembedded-core@lists.openembedded.org) raising your concerns.
Otherwise we would appreciate you correcting the issues and submitting a new
version of the patchset if applicable. Please ensure you add/increment the
version number when sending the new version (i.e. [PATCH] -> [PATCH v2] ->
[PATCH v3] -> ...).
---
Test framework: http://git.yoctoproject.org/cgit/cgit.cgi/patchtest
Test suite: http://git.yoctoproject.org/cgit/cgit.cgi/patchtest-oe
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-07-20 3:31 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-20 3:26 [PATCH] recipetool: create: handle git URLs specifying only a tag Stanley Phoong
2017-07-20 3:26 ` Stanley Phoong
2017-07-20 3:31 ` ✗ patchtest: failure for " Patchwork
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox