|
@@ -987,8 +987,12 @@ class DevtoolTests(DevtoolBase):
|
|
|
@OETestID(1371)
|
|
|
def test_devtool_update_recipe_local_files_2(self):
|
|
|
"""Check local source files support when oe-local-files is in Git"""
|
|
|
- testrecipe = 'lzo'
|
|
|
+ testrecipe = 'devtool-test-local'
|
|
|
recipefile = get_bb_var('FILE', testrecipe)
|
|
|
+ recipedir = os.path.dirname(recipefile)
|
|
|
+ result = runCmd('git status --porcelain .', cwd=recipedir)
|
|
|
+ if result.output.strip():
|
|
|
+ self.fail('Recipe directory for %s contains uncommitted changes' % testrecipe)
|
|
|
# Setup srctree for modifying the recipe
|
|
|
tempdir = tempfile.mkdtemp(prefix='devtoolqa')
|
|
|
self.track_for_cleanup(tempdir)
|
|
@@ -1002,9 +1006,9 @@ class DevtoolTests(DevtoolBase):
|
|
|
runCmd('git add oe-local-files', cwd=tempdir)
|
|
|
runCmd('git commit -m "Add local sources"', cwd=tempdir)
|
|
|
# Edit / commit local sources
|
|
|
- runCmd('echo "# Foobar" >> oe-local-files/acinclude.m4', cwd=tempdir)
|
|
|
+ runCmd('echo "# Foobar" >> oe-local-files/file1', cwd=tempdir)
|
|
|
runCmd('git commit -am "Edit existing file"', cwd=tempdir)
|
|
|
- runCmd('git rm oe-local-files/run-ptest', cwd=tempdir)
|
|
|
+ runCmd('git rm oe-local-files/file2', cwd=tempdir)
|
|
|
runCmd('git commit -m"Remove file"', cwd=tempdir)
|
|
|
runCmd('echo "Foo" > oe-local-files/new-local', cwd=tempdir)
|
|
|
runCmd('git add oe-local-files/new-local', cwd=tempdir)
|
|
@@ -1016,11 +1020,11 @@ class DevtoolTests(DevtoolBase):
|
|
|
os.path.dirname(recipefile))
|
|
|
# Checkout unmodified file to working copy -> devtool should still pick
|
|
|
# the modified version from HEAD
|
|
|
- runCmd('git checkout HEAD^ -- oe-local-files/acinclude.m4', cwd=tempdir)
|
|
|
+ runCmd('git checkout HEAD^ -- oe-local-files/file1', cwd=tempdir)
|
|
|
runCmd('devtool update-recipe %s' % testrecipe)
|
|
|
expected_status = [(' M', '.*/%s$' % os.path.basename(recipefile)),
|
|
|
- (' M', '.*/acinclude.m4$'),
|
|
|
- (' D', '.*/run-ptest$'),
|
|
|
+ (' M', '.*/file1$'),
|
|
|
+ (' D', '.*/file2$'),
|
|
|
('??', '.*/new-local$'),
|
|
|
('??', '.*/0001-Add-new-file.patch$')]
|
|
|
self._check_repo_status(os.path.dirname(recipefile), expected_status)
|