* [PATCH 0/8] devtool fixes
@ 2015-04-23 16:18 Paul Eggleton
2015-04-23 16:18 ` [PATCH 1/8] devtool: modify: use B=S if that is the default for the recipe Paul Eggleton
` (7 more replies)
0 siblings, 8 replies; 12+ messages in thread
From: Paul Eggleton @ 2015-04-23 16:18 UTC (permalink / raw)
To: openembedded-core
This series rolls up 5 patches previously posted by Markus (with very
minor tweaks to a couple of the commit messages), and adds three new
patches from me.
The following changes since commit 166f2587468ae71988c610858aad3f7ef67eccba:
bison: don't depend on help2man (2015-04-21 11:29:30 +0100)
are available in the git repository at:
git://git.openembedded.org/openembedded-core-contrib paule/devtool-fixes2
http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=paule/devtool-fixes2
Markus Lehtonen (5):
devtool: modify: use B=S if that is the default for the recipe
devtool: modify: implement --no-same-dir
oe-selftest: devtool: fix update-recipe test after bd1aa28
devtool: extract: remove patches when S=WORKDIR
devtool: include bbappends in recipe parsing
Paul Eggleton (3):
devtool: handle . in recipe name
devtool: add: use correct bbappend file name with -V option
devtool: reset: avoid errors in case file no longer exists
meta/lib/oe/recipeutils.py | 10 ++---
meta/lib/oeqa/selftest/devtool.py | 15 +++++--
scripts/devtool | 2 +-
scripts/lib/devtool/standard.py | 90 ++++++++++++++++++++++++++++++---------
4 files changed, 86 insertions(+), 31 deletions(-)
--
2.1.0
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 1/8] devtool: modify: use B=S if that is the default for the recipe
2015-04-23 16:18 [PATCH 0/8] devtool fixes Paul Eggleton
@ 2015-04-23 16:18 ` Paul Eggleton
2015-04-23 16:18 ` [PATCH 2/8] devtool: modify: implement --no-same-dir Paul Eggleton
` (6 subsequent siblings)
7 siblings, 0 replies; 12+ messages in thread
From: Paul Eggleton @ 2015-04-23 16:18 UTC (permalink / raw)
To: openembedded-core
From: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Makes the build succeed for packages which do not support separate build
directory, e.g. zlib. The same outcome could be achieved with the
--same-dir option, but, it's generally hard to tell if a random package
would need that option. The negative side effect of this patch is that
dev srctree (of some packages that build fine without this modification)
gets dirtied by build artefacts.
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Acked-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
scripts/lib/devtool/standard.py | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py
index d5ded2f..fbac34e 100644
--- a/scripts/lib/devtool/standard.py
+++ b/scripts/lib/devtool/standard.py
@@ -384,12 +384,19 @@ def modify(args, config, basepath, workspace):
f.write('inherit externalsrc\n')
f.write('# NOTE: We use pn- overrides here to avoid affecting multiple variants in the case where the recipe uses BBCLASSEXTEND\n')
f.write('EXTERNALSRC_pn-%s = "%s"\n' % (args.recipename, srctree))
- if args.same_dir or bb.data.inherits_class('autotools-brokensep', rd):
- if args.same_dir:
- logger.info('using source tree as build directory since --same-dir specified')
- else:
- logger.info('using source tree as build directory since original recipe inherits autotools-brokensep')
+
+ b_is_s = True
+ if args.same_dir:
+ logger.info('using source tree as build directory since --same-dir specified')
+ elif bb.data.inherits_class('autotools-brokensep', rd):
+ logger.info('using source tree as build directory since original recipe inherits autotools-brokensep')
+ elif rd.getVar('B', True) == s:
+ logger.info('using source tree as build directory since that is the default for this recipe')
+ else:
+ b_is_s = False
+ if b_is_s:
f.write('EXTERNALSRC_BUILD_pn-%s = "%s"\n' % (args.recipename, srctree))
+
if initial_rev:
f.write('\n# initial_rev: %s\n' % initial_rev)
for commit in commits:
--
2.1.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 2/8] devtool: modify: implement --no-same-dir
2015-04-23 16:18 [PATCH 0/8] devtool fixes Paul Eggleton
2015-04-23 16:18 ` [PATCH 1/8] devtool: modify: use B=S if that is the default for the recipe Paul Eggleton
@ 2015-04-23 16:18 ` Paul Eggleton
2015-04-23 16:18 ` [PATCH 3/8] oe-selftest: devtool: fix update-recipe test after bd1aa28 Paul Eggleton
` (5 subsequent siblings)
7 siblings, 0 replies; 12+ messages in thread
From: Paul Eggleton @ 2015-04-23 16:18 UTC (permalink / raw)
To: openembedded-core
From: Markus Lehtonen <markus.lehtonen@linux.intel.com>
This option can be used to have a separate build directory, in order to
keep the srctree directory clean for packages that do not need to be
built in the source directory.
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
---
scripts/lib/devtool/standard.py | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py
index fbac34e..aa30a98 100644
--- a/scripts/lib/devtool/standard.py
+++ b/scripts/lib/devtool/standard.py
@@ -386,7 +386,10 @@ def modify(args, config, basepath, workspace):
f.write('EXTERNALSRC_pn-%s = "%s"\n' % (args.recipename, srctree))
b_is_s = True
- if args.same_dir:
+ if args.no_same_dir:
+ logger.info('using separate build directory since --no-same-dir specified')
+ b_is_s = False
+ elif args.same_dir:
logger.info('using source tree as build directory since --same-dir specified')
elif bb.data.inherits_class('autotools-brokensep', rd):
logger.info('using source tree as build directory since original recipe inherits autotools-brokensep')
@@ -664,7 +667,9 @@ def register_commands(subparsers, context):
parser_modify.add_argument('srctree', help='Path to external source tree')
parser_modify.add_argument('--wildcard', '-w', action="store_true", help='Use wildcard for unversioned bbappend')
parser_modify.add_argument('--extract', '-x', action="store_true", help='Extract source as well')
- parser_modify.add_argument('--same-dir', '-s', help='Build in same directory as source', action="store_true")
+ group = parser_modify.add_mutually_exclusive_group()
+ group.add_argument('--same-dir', '-s', help='Build in same directory as source', action="store_true")
+ group.add_argument('--no-same-dir', help='Force build in a separate build directory', action="store_true")
parser_modify.add_argument('--branch', '-b', default="devtool", help='Name for development branch to checkout (only when using -x)')
parser_modify.set_defaults(func=modify)
--
2.1.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 3/8] oe-selftest: devtool: fix update-recipe test after bd1aa28
2015-04-23 16:18 [PATCH 0/8] devtool fixes Paul Eggleton
2015-04-23 16:18 ` [PATCH 1/8] devtool: modify: use B=S if that is the default for the recipe Paul Eggleton
2015-04-23 16:18 ` [PATCH 2/8] devtool: modify: implement --no-same-dir Paul Eggleton
@ 2015-04-23 16:18 ` Paul Eggleton
2015-04-23 16:18 ` [PATCH 4/8] devtool: extract: remove patches when S=WORKDIR Paul Eggleton
` (4 subsequent siblings)
7 siblings, 0 replies; 12+ messages in thread
From: Paul Eggleton @ 2015-04-23 16:18 UTC (permalink / raw)
To: openembedded-core
From: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Number of patches in mtd-utils changed in changeset bd1aa28.
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
---
meta/lib/oeqa/selftest/devtool.py | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/meta/lib/oeqa/selftest/devtool.py b/meta/lib/oeqa/selftest/devtool.py
index dc1cf21..aa5bd76 100644
--- a/meta/lib/oeqa/selftest/devtool.py
+++ b/meta/lib/oeqa/selftest/devtool.py
@@ -397,19 +397,26 @@ class DevtoolTests(oeSelfTest):
result = runCmd('git status . --porcelain', cwd=os.path.dirname(recipefile))
self.assertNotEqual(result.output.strip(), "", '%s recipe should be modified' % testrecipe)
status = result.output.splitlines()
- self.assertEqual(len(status), 3, 'Less/more files modified than expected. Entire status:\n%s' % result.output)
+ self.assertEqual(len(status), 4, 'Less/more files modified than expected. Entire status:\n%s' % result.output)
for line in status:
if line.endswith('add-exclusion-to-mkfs-jffs2-git-2.patch'):
self.assertEqual(line[:3], ' D ', 'Unexpected status in line: %s' % line)
elif line.endswith('fix-armv7-neon-alignment.patch'):
self.assertEqual(line[:3], ' D ', 'Unexpected status in line: %s' % line)
+ elif line.endswith('-duplicate-hashtable_iterator_value-.patch'):
+ self.assertEqual(line[:3], ' D ', 'Unexpected status in line: %s' % line)
elif re.search('%s_[^_]*.bb$' % testrecipe, line):
self.assertEqual(line[:3], ' M ', 'Unexpected status in line: %s' % line)
else:
raise AssertionError('Unexpected modified file in status: %s' % line)
result = runCmd('git diff %s' % os.path.basename(recipefile), cwd=os.path.dirname(recipefile))
addlines = ['SRCREV = ".*"', 'SRC_URI = "git://git.infradead.org/mtd-utils.git"']
- removelines = ['SRCREV = ".*"', 'SRC_URI = "git://git.infradead.org/mtd-utils.git \\\\', 'file://add-exclusion-to-mkfs-jffs2-git-2.patch \\\\', 'file://fix-armv7-neon-alignment.patch \\\\', '"']
+ removelines = ['SRCREV = ".*"',
+ 'SRC_URI = "git://git.infradead.org/mtd-utils.git \\\\',
+ 'file://add-exclusion-to-mkfs-jffs2-git-2.patch \\\\',
+ 'file://fix-armv7-neon-alignment.patch \\\\',
+ 'file://0001-hashtable-Remove-duplicate-hashtable_iterator_value-.patch \\\\',
+ '"']
for line in result.output.splitlines():
if line.startswith('+++') or line.startswith('---'):
continue
--
2.1.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 4/8] devtool: extract: remove patches when S=WORKDIR
2015-04-23 16:18 [PATCH 0/8] devtool fixes Paul Eggleton
` (2 preceding siblings ...)
2015-04-23 16:18 ` [PATCH 3/8] oe-selftest: devtool: fix update-recipe test after bd1aa28 Paul Eggleton
@ 2015-04-23 16:18 ` Paul Eggleton
2015-04-24 8:38 ` Markus Lehtonen
2015-04-23 16:18 ` [PATCH 5/8] devtool: include bbappends in recipe parsing Paul Eggleton
` (3 subsequent siblings)
7 siblings, 1 reply; 12+ messages in thread
From: Paul Eggleton @ 2015-04-23 16:18 UTC (permalink / raw)
To: openembedded-core
From: Markus Lehtonen <markus.lehtonen@linux.intel.com>
All local files from the layer, including patches, are added to to
srctree repository when S==WORKDIR. The patch files are useless as they
are automatically applied on top of the srctree by devtool.
This change causes devtool extract to not commit these unnecessary (and
possibly confusing) patch file(s) into srctree repository.
[YOCTO #7602]
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
---
scripts/lib/devtool/standard.py | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py
index aa30a98..926ec6c 100644
--- a/scripts/lib/devtool/standard.py
+++ b/scripts/lib/devtool/standard.py
@@ -153,6 +153,7 @@ def extract(args, config, basepath, workspace):
def _extract_source(srctree, keep_temp, devbranch, d):
import bb.event
+ import oe.recipeutils
def eventfilter(name, handler, event, d):
if name == 'base_eventhandler':
@@ -240,6 +241,13 @@ def _extract_source(srctree, keep_temp, devbranch, d):
else:
os.rmdir(patchdir)
+ # Find local patches that were "unpacked" to srctree directory
+ recipe_patches = [os.path.basename(patch) for patch in
+ oe.recipeutils.get_recipe_patches(crd)]
+ patches = [fname for fname in os.listdir(workdir) if fname in
+ recipe_patches]
+
+ # Set-up srctree repo
if bb.data.inherits_class('kernel-yocto', d):
(stdout, _) = bb.process.run('git --git-dir="%s" rev-parse HEAD' % crd.expand('${WORKDIR}/git'), cwd=srcsubdir)
initial_rev = stdout.rstrip()
@@ -251,6 +259,10 @@ def _extract_source(srctree, keep_temp, devbranch, d):
if not os.path.exists(os.path.join(srcsubdir, '.git')):
bb.process.run('git init', cwd=srcsubdir)
bb.process.run('git add .', cwd=srcsubdir)
+ # Do not commit patches (would happend if S=WORKDIR)
+ if patches and srcsubdir == workdir:
+ bb.process.run('git reset -- %s' % " ".join(patches),
+ cwd=srcsubdir)
bb.process.run('git commit -q -m "Initial commit from upstream at version %s"' % crd.getVar('PV', True), cwd=srcsubdir)
(stdout, _) = bb.process.run('git rev-parse HEAD', cwd=srcsubdir)
@@ -266,6 +278,14 @@ def _extract_source(srctree, keep_temp, devbranch, d):
bb.process.run('git tag -f devtool-patched', cwd=srcsubdir)
+ # Remove patches if S=WORKDIR so that stale patch files are not present
+ # in the srtree
+ if patches and srcsubdir == workdir:
+ logger.info('Removing patch files...')
+ for patch in patches:
+ os.unlink(os.path.join(workdir, patch))
+
+
if os.path.exists(patchdir):
shutil.rmtree(patchdir)
if haspatches:
--
2.1.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 5/8] devtool: include bbappends in recipe parsing
2015-04-23 16:18 [PATCH 0/8] devtool fixes Paul Eggleton
` (3 preceding siblings ...)
2015-04-23 16:18 ` [PATCH 4/8] devtool: extract: remove patches when S=WORKDIR Paul Eggleton
@ 2015-04-23 16:18 ` Paul Eggleton
2015-04-23 16:18 ` [PATCH 6/8] devtool: handle . in recipe name Paul Eggleton
` (2 subsequent siblings)
7 siblings, 0 replies; 12+ messages in thread
From: Paul Eggleton @ 2015-04-23 16:18 UTC (permalink / raw)
To: openembedded-core
From: Markus Lehtonen <markus.lehtonen@linux.intel.com>
In order to get correct metadata, SRCREV for example.
Fixes [YOCTO #7648].
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
---
meta/lib/oe/recipeutils.py | 6 +++---
scripts/lib/devtool/standard.py | 35 ++++++++++++++++++++++-------------
2 files changed, 25 insertions(+), 16 deletions(-)
diff --git a/meta/lib/oe/recipeutils.py b/meta/lib/oe/recipeutils.py
index 159a103..09bd7fd 100644
--- a/meta/lib/oe/recipeutils.py
+++ b/meta/lib/oe/recipeutils.py
@@ -44,10 +44,10 @@ def get_unavailable_reasons(cooker, pn):
return taskdata.get_reasons(pn)
-def parse_recipe(fn, d):
+def parse_recipe(fn, appends, d):
"""Parse an individual recipe"""
import bb.cache
- envdata = bb.cache.Cache.loadDataFull(fn, [], d)
+ envdata = bb.cache.Cache.loadDataFull(fn, appends, d)
return envdata
@@ -55,7 +55,7 @@ def get_var_files(fn, varlist, d):
"""Find the file in which each of a list of variables is set.
Note: requires variable history to be enabled when parsing.
"""
- envdata = parse_recipe(fn, d)
+ envdata = parse_recipe(fn, [], d)
varfiles = {}
for v in varlist:
history = envdata.varhistory.variable(v)
diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py
index 926ec6c..9abdbd4 100644
--- a/scripts/lib/devtool/standard.py
+++ b/scripts/lib/devtool/standard.py
@@ -130,18 +130,29 @@ def _get_recipe_file(cooker, pn):
logger.error("Unable to find any recipe file matching %s" % pn)
return recipefile
+def _parse_recipe(config, tinfoil, pn, appends):
+ """Parse recipe of a package"""
+ import oe.recipeutils
+ recipefile = _get_recipe_file(tinfoil.cooker, pn)
+ if not recipefile:
+ # Error already logged
+ return None
+ if appends:
+ append_files = tinfoil.cooker.collection.get_file_appends(recipefile)
+ # Filter out appends from the workspace
+ append_files = [path for path in append_files if
+ not path.startswith(config.workspace_path)]
+ return oe.recipeutils.parse_recipe(recipefile, append_files,
+ tinfoil.config_data)
def extract(args, config, basepath, workspace):
import bb
- import oe.recipeutils
tinfoil = setup_tinfoil()
- recipefile = _get_recipe_file(tinfoil.cooker, args.recipename)
- if not recipefile:
- # Error already logged
+ rd = _parse_recipe(config, tinfoil, args.recipename, True)
+ if not rd:
return -1
- rd = oe.recipeutils.parse_recipe(recipefile, tinfoil.config_data)
srctree = os.path.abspath(args.srctree)
initial_rev = _extract_source(srctree, args.keep_temp, args.branch, rd)
@@ -347,11 +358,10 @@ def modify(args, config, basepath, workspace):
tinfoil = setup_tinfoil()
- recipefile = _get_recipe_file(tinfoil.cooker, args.recipename)
- if not recipefile:
- # Error already logged
+ rd = _parse_recipe(config, tinfoil, args.recipename, True)
+ if not rd:
return -1
- rd = oe.recipeutils.parse_recipe(recipefile, tinfoil.config_data)
+ recipefile = rd.getVar('FILE', True)
if not _check_compatible_recipe(args.recipename, rd):
return -1
@@ -448,11 +458,10 @@ def update_recipe(args, config, basepath, workspace):
from oe.patch import GitApplyTree
import oe.recipeutils
- recipefile = _get_recipe_file(tinfoil.cooker, args.recipename)
- if not recipefile:
- # Error already logged
+ rd = _parse_recipe(config, tinfoil, args.recipename, True)
+ if not rd:
return -1
- rd = oe.recipeutils.parse_recipe(recipefile, tinfoil.config_data)
+ recipefile = rd.getVar('FILE', True)
orig_src_uri = rd.getVar('SRC_URI', False) or ''
if args.mode == 'auto':
--
2.1.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 6/8] devtool: handle . in recipe name
2015-04-23 16:18 [PATCH 0/8] devtool fixes Paul Eggleton
` (4 preceding siblings ...)
2015-04-23 16:18 ` [PATCH 5/8] devtool: include bbappends in recipe parsing Paul Eggleton
@ 2015-04-23 16:18 ` Paul Eggleton
2015-04-23 16:18 ` [PATCH 7/8] devtool: add: use correct bbappend file name with -V option Paul Eggleton
2015-04-23 16:18 ` [PATCH 8/8] devtool: reset: avoid errors in case file no longer exists Paul Eggleton
7 siblings, 0 replies; 12+ messages in thread
From: Paul Eggleton @ 2015-04-23 16:18 UTC (permalink / raw)
To: openembedded-core
Names such as glib-2.0 are valid (and used) recipe names, so we need to
support them.
Fixes [YOCTO #7643].
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
meta/lib/oe/recipeutils.py | 4 ++--
scripts/devtool | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/meta/lib/oe/recipeutils.py b/meta/lib/oe/recipeutils.py
index 09bd7fd..19d97b6 100644
--- a/meta/lib/oe/recipeutils.py
+++ b/meta/lib/oe/recipeutils.py
@@ -269,8 +269,8 @@ def get_recipe_patches(d):
def validate_pn(pn):
"""Perform validation on a recipe name (PN) for a new recipe."""
reserved_names = ['forcevariable', 'append', 'prepend', 'remove']
- if not re.match('[0-9a-z-]+', pn):
- return 'Recipe name "%s" is invalid: only characters 0-9, a-z and - are allowed' % pn
+ if not re.match('[0-9a-z-.]+', pn):
+ return 'Recipe name "%s" is invalid: only characters 0-9, a-z, - and . are allowed' % pn
elif pn in reserved_names:
return 'Recipe name "%s" is invalid: is a reserved keyword' % pn
elif pn.startswith('pn-'):
diff --git a/scripts/devtool b/scripts/devtool
index 981ff51..841831c 100755
--- a/scripts/devtool
+++ b/scripts/devtool
@@ -101,7 +101,7 @@ def read_workspace():
_create_workspace(config.workspace_path, config, basepath)
logger.debug('Reading workspace in %s' % config.workspace_path)
- externalsrc_re = re.compile(r'^EXTERNALSRC(_pn-[a-zA-Z0-9-]*)? =.*$')
+ externalsrc_re = re.compile(r'^EXTERNALSRC(_pn-[^ =]+)? =.*$')
for fn in glob.glob(os.path.join(config.workspace_path, 'appends', '*.bbappend')):
pn = os.path.splitext(os.path.basename(fn))[0].split('_')[0]
with open(fn, 'r') as f:
--
2.1.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 7/8] devtool: add: use correct bbappend file name with -V option
2015-04-23 16:18 [PATCH 0/8] devtool fixes Paul Eggleton
` (5 preceding siblings ...)
2015-04-23 16:18 ` [PATCH 6/8] devtool: handle . in recipe name Paul Eggleton
@ 2015-04-23 16:18 ` Paul Eggleton
2015-04-23 16:18 ` [PATCH 8/8] devtool: reset: avoid errors in case file no longer exists Paul Eggleton
7 siblings, 0 replies; 12+ messages in thread
From: Paul Eggleton @ 2015-04-23 16:18 UTC (permalink / raw)
To: openembedded-core
We weren't adding the version into the bbappend file name which meant
that building or resetting failed.
Also adjust one of the tests so that we're testing devtool add both with
and without this option.
Fixes [YOCTO #7647].
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
meta/lib/oeqa/selftest/devtool.py | 4 ++--
scripts/lib/devtool/standard.py | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/meta/lib/oeqa/selftest/devtool.py b/meta/lib/oeqa/selftest/devtool.py
index aa5bd76..91d4c39 100644
--- a/meta/lib/oeqa/selftest/devtool.py
+++ b/meta/lib/oeqa/selftest/devtool.py
@@ -150,10 +150,10 @@ class DevtoolTests(oeSelfTest):
result = runCmd('tar xfv libftdi1-1.1.tar.bz2', cwd=tempdir)
srcdir = os.path.join(tempdir, 'libftdi1-1.1')
self.assertTrue(os.path.isfile(os.path.join(srcdir, 'CMakeLists.txt')), 'Unable to find CMakeLists.txt in source directory')
- # Test devtool add
+ # Test devtool add (and use -V so we test that too)
self.track_for_cleanup(workspacedir)
self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
- result = runCmd('devtool add libftdi %s' % srcdir)
+ result = runCmd('devtool add libftdi %s -V 1.1' % srcdir)
self.assertTrue(os.path.exists(os.path.join(workspacedir, 'conf', 'layer.conf')), 'Workspace directory not created')
# Test devtool status
result = runCmd('devtool status')
diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py
index 9abdbd4..8fa9e6f 100644
--- a/scripts/lib/devtool/standard.py
+++ b/scripts/lib/devtool/standard.py
@@ -73,7 +73,7 @@ def add(args, config, basepath, workspace):
(stdout, _) = bb.process.run('git rev-parse HEAD', cwd=srctree)
initial_rev = stdout.rstrip()
- appendfile = os.path.join(appendpath, '%s.bbappend' % args.recipename)
+ appendfile = os.path.join(appendpath, '%s.bbappend' % bp)
with open(appendfile, 'w') as f:
f.write('inherit externalsrc\n')
f.write('EXTERNALSRC = "%s"\n' % srctree)
--
2.1.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 8/8] devtool: reset: avoid errors in case file no longer exists
2015-04-23 16:18 [PATCH 0/8] devtool fixes Paul Eggleton
` (6 preceding siblings ...)
2015-04-23 16:18 ` [PATCH 7/8] devtool: add: use correct bbappend file name with -V option Paul Eggleton
@ 2015-04-23 16:18 ` Paul Eggleton
7 siblings, 0 replies; 12+ messages in thread
From: Paul Eggleton @ 2015-04-23 16:18 UTC (permalink / raw)
To: openembedded-core
If you manually delete files in the workspace layer (which you really
shouldn't) it was possible to get yourself into the situation where you
couldn't reset because we were attempting to check if the file had been
modified and erroring out if it couldn't be opened. If the file's not
there anymore there's not much point checking if it needs to be
preserved, just skip it.
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
scripts/lib/devtool/standard.py | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py
index 8fa9e6f..9d13db5 100644
--- a/scripts/lib/devtool/standard.py
+++ b/scripts/lib/devtool/standard.py
@@ -328,7 +328,14 @@ def _check_preserve(config, recipename):
splitline = line.rstrip().split('|')
if splitline[0] == recipename:
removefile = os.path.join(config.workspace_path, splitline[1])
- md5 = bb.utils.md5_file(removefile)
+ try:
+ md5 = bb.utils.md5_file(removefile)
+ except IOError as err:
+ if err.errno == 2:
+ # File no longer exists, skip it
+ continue
+ else:
+ raise
if splitline[2] != md5:
bb.utils.mkdirhier(preservepath)
preservefile = os.path.basename(removefile)
--
2.1.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH 4/8] devtool: extract: remove patches when S=WORKDIR
2015-04-23 16:18 ` [PATCH 4/8] devtool: extract: remove patches when S=WORKDIR Paul Eggleton
@ 2015-04-24 8:38 ` Markus Lehtonen
2015-04-24 8:41 ` Paul Eggleton
0 siblings, 1 reply; 12+ messages in thread
From: Markus Lehtonen @ 2015-04-24 8:38 UTC (permalink / raw)
To: Paul Eggleton, openembedded-core
Hi,
On 23/04/15 19:18, "Paul Eggleton" <paul.eggleton@linux.intel.com> wrote:
>From: Markus Lehtonen <markus.lehtonen@linux.intel.com>
>
>All local files from the layer, including patches, are added to to
>srctree repository when S==WORKDIR. The patch files are useless as they
>are automatically applied on top of the srctree by devtool.
>
>This change causes devtool extract to not commit these unnecessary (and
>possibly confusing) patch file(s) into srctree repository.
>
>[YOCTO #7602]
>
>Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
>---
> scripts/lib/devtool/standard.py | 20 ++++++++++++++++++++
> 1 file changed, 20 insertions(+)
>
>diff --git a/scripts/lib/devtool/standard.py
>b/scripts/lib/devtool/standard.py
>index aa30a98..926ec6c 100644
>--- a/scripts/lib/devtool/standard.py
>+++ b/scripts/lib/devtool/standard.py
>@@ -153,6 +153,7 @@ def extract(args, config, basepath, workspace):
>
> def _extract_source(srctree, keep_temp, devbranch, d):
> import bb.event
>+ import oe.recipeutils
>
> def eventfilter(name, handler, event, d):
> if name == 'base_eventhandler':
>@@ -240,6 +241,13 @@ def _extract_source(srctree, keep_temp, devbranch,
>d):
> else:
> os.rmdir(patchdir)
>
>+ # Find local patches that were "unpacked" to srctree directory
>+ recipe_patches = [os.path.basename(patch) for patch in
>+ oe.recipeutils.get_recipe_patches(crd)]
>+ patches = [fname for fname in os.listdir(workdir) if fname in
>+ recipe_patches]
>+
>+ # Set-up srctree repo
> if bb.data.inherits_class('kernel-yocto', d):
> (stdout, _) = bb.process.run('git --git-dir="%s" rev-parse
>HEAD' % crd.expand('${WORKDIR}/git'), cwd=srcsubdir)
> initial_rev = stdout.rstrip()
>@@ -251,6 +259,10 @@ def _extract_source(srctree, keep_temp, devbranch,
>d):
> if not os.path.exists(os.path.join(srcsubdir, '.git')):
> bb.process.run('git init', cwd=srcsubdir)
> bb.process.run('git add .', cwd=srcsubdir)
>+ # Do not commit patches (would happend if S=WORKDIR)
>+ if patches and srcsubdir == workdir:
>+ bb.process.run('git reset -- %s' % " ".join(patches),
>+ cwd=srcsubdir)
> bb.process.run('git commit -q -m "Initial commit from
>upstream at version %s"' % crd.getVar('PV', True), cwd=srcsubdir)
>
> (stdout, _) = bb.process.run('git rev-parse HEAD',
>cwd=srcsubdir)
>@@ -266,6 +278,14 @@ def _extract_source(srctree, keep_temp, devbranch,
>d):
>
> bb.process.run('git tag -f devtool-patched', cwd=srcsubdir)
>
>+ # Remove patches if S=WORKDIR so that stale patch files are not
>present
>+ # in the srtree
>+ if patches and srcsubdir == workdir:
>+ logger.info('Removing patch files...')
>+ for patch in patches:
>+ os.unlink(os.path.join(workdir, patch))
>+
>+
> if os.path.exists(patchdir):
> shutil.rmtree(patchdir)
> if haspatches:
NACK! Please skip this patch for now. I just found out it doesn't work as
expected. I'll submit a new version when I've worked around the problems.
Thanks,
Markus
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 4/8] devtool: extract: remove patches when S=WORKDIR
2015-04-24 8:38 ` Markus Lehtonen
@ 2015-04-24 8:41 ` Paul Eggleton
0 siblings, 0 replies; 12+ messages in thread
From: Paul Eggleton @ 2015-04-24 8:41 UTC (permalink / raw)
To: openembedded-core
On Friday 24 April 2015 11:38:45 Markus Lehtonen wrote:
> NACK! Please skip this patch for now. I just found out it doesn't work as
> expected. I'll submit a new version when I've worked around the problems.
OK, I've re-pushed the branch with this patch removed.
Cheers,
Paul
--
Paul Eggleton
Intel Open Source Technology Centre
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 0/8] devtool fixes
@ 2018-02-23 3:02 Paul Eggleton
0 siblings, 0 replies; 12+ messages in thread
From: Paul Eggleton @ 2018-02-23 3:02 UTC (permalink / raw)
To: openembedded-core
This incorporates several of the fixes from my previous series and adds
a few others - I've excluded the multi-source changes from the previous
series as they may not be ready yet and it's too late in the release
cycle now. These have all passed through oe-selftest locally.
The following changes since commit 6e5dbb53a7cbd05baf07de62b1abc88dccfd4cb9:
nativesdk-qemu-helper: add a missing nativesdk-python3-logging dependency (2018-02-22 16:02:17 +0000)
are available in the Git repository at:
git://git.openembedded.org/openembedded-core-contrib paule/devtool33-oe
http://cgit.openembedded.org/openembedded-core-contrib/log/?h=paule/devtool33-oe
Paul Eggleton (8):
lib/oe/path: implement is_path_under()
devtool: fix poor handling of upgraded BBCLASSEXTENDed recipes
devtool: reset: delete bbappend file if _check_preserve() doesn't
devtool: finish: fix erroneously creating bbappend for relative paths
devtool: deploy-target: don't specify ssh/scp port unless user does
lib/oe/recipeutils: add .txz extension to archive list
devtool: search: also look in recipe cache
devtool: search: tweak help text
meta/lib/oe/path.py | 24 ++++++++++
meta/lib/oe/recipeutils.py | 2 +-
scripts/devtool | 5 +-
scripts/lib/devtool/deploy.py | 12 ++---
scripts/lib/devtool/search.py | 100 ++++++++++++++++++++++++++--------------
scripts/lib/devtool/standard.py | 17 +++++--
6 files changed, 110 insertions(+), 50 deletions(-)
--
2.14.3
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2018-02-23 3:02 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-23 16:18 [PATCH 0/8] devtool fixes Paul Eggleton
2015-04-23 16:18 ` [PATCH 1/8] devtool: modify: use B=S if that is the default for the recipe Paul Eggleton
2015-04-23 16:18 ` [PATCH 2/8] devtool: modify: implement --no-same-dir Paul Eggleton
2015-04-23 16:18 ` [PATCH 3/8] oe-selftest: devtool: fix update-recipe test after bd1aa28 Paul Eggleton
2015-04-23 16:18 ` [PATCH 4/8] devtool: extract: remove patches when S=WORKDIR Paul Eggleton
2015-04-24 8:38 ` Markus Lehtonen
2015-04-24 8:41 ` Paul Eggleton
2015-04-23 16:18 ` [PATCH 5/8] devtool: include bbappends in recipe parsing Paul Eggleton
2015-04-23 16:18 ` [PATCH 6/8] devtool: handle . in recipe name Paul Eggleton
2015-04-23 16:18 ` [PATCH 7/8] devtool: add: use correct bbappend file name with -V option Paul Eggleton
2015-04-23 16:18 ` [PATCH 8/8] devtool: reset: avoid errors in case file no longer exists Paul Eggleton
-- strict thread matches above, loose matches on Subject: below --
2018-02-23 3:02 [PATCH 0/8] devtool fixes Paul Eggleton
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.