summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2014-12-19 10:20:31 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-12-23 10:18:21 +0000
commitdb3f589f491b5664520a0dd7b420c78633efba54 (patch)
treebbcec3e6f95959dc2b78234eec44c4e732d9004b /bitbake
parentb1e5a6794f1631a82c57fad0724ddf5fb9639652 (diff)
downloadpoky-db3f589f491b5664520a0dd7b420c78633efba54.tar.gz
bitbake: bitbake-layers: add commands for adding and removing layers
Add add-layer and remove-layer commands for easily adding and removing layers to/from bblayers.conf. (Bitbake rev: 0e94aed033917b91ea6ba0522b14a040c3bdc987) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rwxr-xr-xbitbake/bin/bitbake-layers54
1 files changed, 54 insertions, 0 deletions
diff --git a/bitbake/bin/bitbake-layers b/bitbake/bin/bitbake-layers
index 9964040bf7..edb4d2f03a 100755
--- a/bitbake/bin/bitbake-layers
+++ b/bitbake/bin/bitbake-layers
@@ -103,6 +103,60 @@ class Commands(cmd.Cmd):
103 logger.plain("%s %s %d" % (layername.ljust(20), layerdir.ljust(40), layerpri)) 103 logger.plain("%s %s %d" % (layername.ljust(20), layerdir.ljust(40), layerpri))
104 104
105 105
106 def do_add_layer(self, dirname):
107 """Add a layer to bblayers.conf
108
109usage: add-layer <layerdir>
110"""
111 if not dirname:
112 sys.stderr.write("Please specify the layer directory to add\n")
113 return
114
115 layerdir = os.path.abspath(dirname)
116 if not os.path.exists(layerdir):
117 sys.stderr.write("Specified layer directory doesn't exist\n")
118 return
119
120 layer_conf = os.path.join(layerdir, 'conf', 'layer.conf')
121 if not os.path.exists(layer_conf):
122 sys.stderr.write("Specified layer directory doesn't contain a conf/layer.conf file\n")
123 return
124
125 bblayers_conf = os.path.join('conf', 'bblayers.conf')
126 if not os.path.exists(bblayers_conf):
127 sys.stderr.write("Unable to find bblayers.conf\n")
128 return
129
130 (notadded, _) = bb.utils.edit_bblayers_conf(bblayers_conf, layerdir, None)
131 if notadded:
132 for item in notadded:
133 sys.stderr.write("Specified layer %s not in BBLAYERS\n" % item)
134
135
136 def do_remove_layer(self, dirname):
137 """Remove a layer from bblayers.conf
138
139usage: remove-layer <layerdir>
140"""
141 if not dirname:
142 sys.stderr.write("Please specify the layer directory to remove\n")
143 return
144
145 bblayers_conf = os.path.join('conf', 'bblayers.conf')
146 if not os.path.exists(bblayers_conf):
147 sys.stderr.write("Unable to find bblayers.conf\n")
148 return
149
150 if dirname.startswith('*'):
151 layerdir = dirname
152 else:
153 layerdir = os.path.abspath(dirname)
154 (_, notremoved) = bb.utils.edit_bblayers_conf(bblayers_conf, None, layerdir)
155 if notremoved:
156 for item in notremoved:
157 sys.stderr.write("No layers matching %s found in BBLAYERS\n" % item)
158
159
106 def version_str(self, pe, pv, pr = None): 160 def version_str(self, pe, pv, pr = None):
107 verstr = "%s" % pv 161 verstr = "%s" % pv
108 if pr: 162 if pr: