summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bblayers/action.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bblayers/action.py')
-rw-r--r--bitbake/lib/bblayers/action.py15
1 files changed, 12 insertions, 3 deletions
diff --git a/bitbake/lib/bblayers/action.py b/bitbake/lib/bblayers/action.py
index f05f5d330f..a8f2699335 100644
--- a/bitbake/lib/bblayers/action.py
+++ b/bitbake/lib/bblayers/action.py
@@ -1,4 +1,6 @@
#
+# Copyright BitBake Contributors
+#
# SPDX-License-Identifier: GPL-2.0-only
#
@@ -9,6 +11,7 @@ import shutil
import sys
import tempfile
+from bb.cookerdata import findTopdir
import bb.utils
from bblayers.common import LayerPlugin
@@ -35,7 +38,7 @@ class ActionPlugin(LayerPlugin):
sys.stderr.write("Specified layer directory %s doesn't contain a conf/layer.conf file\n" % layerdir)
return 1
- bblayers_conf = os.path.join('conf', 'bblayers.conf')
+ bblayers_conf = os.path.join(findTopdir(),'conf', 'bblayers.conf')
if not os.path.exists(bblayers_conf):
sys.stderr.write("Unable to find bblayers.conf\n")
return 1
@@ -47,13 +50,15 @@ class ActionPlugin(LayerPlugin):
try:
notadded, _ = bb.utils.edit_bblayers_conf(bblayers_conf, layerdirs, None)
+ self.tinfoil.modified_files()
if not (args.force or notadded):
try:
self.tinfoil.run_command('parseConfiguration')
except (bb.tinfoil.TinfoilUIException, bb.BBHandledException):
# Restore the back up copy of bblayers.conf
shutil.copy2(backup, bblayers_conf)
- bb.fatal("Parse failure with the specified layer added, aborting.")
+ self.tinfoil.modified_files()
+ bb.fatal("Parse failure with the specified layer added, exiting.")
else:
for item in notadded:
sys.stderr.write("Specified layer %s is already in BBLAYERS\n" % item)
@@ -63,7 +68,7 @@ class ActionPlugin(LayerPlugin):
def do_remove_layer(self, args):
"""Remove one or more layers from bblayers.conf."""
- bblayers_conf = os.path.join('conf', 'bblayers.conf')
+ bblayers_conf = os.path.join(findTopdir() ,'conf', 'bblayers.conf')
if not os.path.exists(bblayers_conf):
sys.stderr.write("Unable to find bblayers.conf\n")
return 1
@@ -78,6 +83,7 @@ class ActionPlugin(LayerPlugin):
layerdir = os.path.abspath(item)
layerdirs.append(layerdir)
(_, notremoved) = bb.utils.edit_bblayers_conf(bblayers_conf, None, layerdirs)
+ self.tinfoil.modified_files()
if notremoved:
for item in notremoved:
sys.stderr.write("No layers matching %s found in BBLAYERS\n" % item)
@@ -237,6 +243,9 @@ build results (as the layer priority order has effectively changed).
if not entry_found:
logger.warning("File %s does not match the flattened layer's BBFILES setting, you may need to edit conf/layer.conf or move the file elsewhere" % f1full)
+ self.tinfoil.modified_files()
+
+
def get_file_layer(self, filename):
layerdir = self.get_file_layerdir(filename)
if layerdir: