summaryrefslogtreecommitdiffstats
path: root/bitbake/bin/bitbake-layers
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/bin/bitbake-layers')
-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: