summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2013-05-07 13:55:56 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-05-09 14:06:50 +0100
commitdb8217f6b89be11a17e9f3cba7d98be64d8aded1 (patch)
tree8bd8c54c90035d3fbe4d7e9a85fe701b535d7a4a
parente0bd393be8e6419cd19dd860c75de75ea73c7509 (diff)
downloadpoky-db8217f6b89be11a17e9f3cba7d98be64d8aded1.tar.gz
classes: Use modern exception raising syntax
Modern expection rasing syntax is function call format, convert to this to keep python 3 happy and model correct coding style in the core. (From OE-Core rev: f4b382754603d3f1caa13824bcc8d06b568bbc59) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/gtk-immodules-cache.bbclass2
-rw-r--r--meta/classes/systemd.bbclass4
-rw-r--r--meta/classes/update-alternatives.bbclass4
-rw-r--r--meta/classes/update-rc.d.bbclass4
-rw-r--r--meta/classes/useradd.bbclass4
5 files changed, 9 insertions, 9 deletions
diff --git a/meta/classes/gtk-immodules-cache.bbclass b/meta/classes/gtk-immodules-cache.bbclass
index ed3069daaf..e11ed222d6 100644
--- a/meta/classes/gtk-immodules-cache.bbclass
+++ b/meta/classes/gtk-immodules-cache.bbclass
@@ -78,6 +78,6 @@ python __anonymous() {
78 gtkimmodules_check = d.getVar('GTKIMMODULES_PACKAGES') 78 gtkimmodules_check = d.getVar('GTKIMMODULES_PACKAGES')
79 if not gtkimmodules_check: 79 if not gtkimmodules_check:
80 bb_filename = d.getVar('FILE') 80 bb_filename = d.getVar('FILE')
81 raise bb.build.FuncFailed, "\n\n\nERROR: %s inherits gtk-immodule-cache but doesn't set GTKIMMODULES_PACKAGE" % bb_filename 81 raise bb.build.FuncFailed("ERROR: %s inherits gtk-immodule-cache but doesn't set GTKIMMODULES_PACKAGE" % bb_filename)
82} 82}
83 83
diff --git a/meta/classes/systemd.bbclass b/meta/classes/systemd.bbclass
index 8084251f13..86d9a9a835 100644
--- a/meta/classes/systemd.bbclass
+++ b/meta/classes/systemd.bbclass
@@ -146,8 +146,8 @@ python systemd_populate_packages() {
146 if path_found != '': 146 if path_found != '':
147 systemd_add_files_and_parse(pkg_systemd, path_found, service, keys) 147 systemd_add_files_and_parse(pkg_systemd, path_found, service, keys)
148 else: 148 else:
149 raise bb.build.FuncFailed, "\n\nSYSTEMD_SERVICE_%s value %s does not exist" % \ 149 raise bb.build.FuncFailed("SYSTEMD_SERVICE_%s value %s does not exist" % \
150 (pkg_systemd, service) 150 (pkg_systemd, service))
151 151
152 # Run all modifications once when creating package 152 # Run all modifications once when creating package
153 if os.path.exists(d.getVar("D", True)): 153 if os.path.exists(d.getVar("D", True)):
diff --git a/meta/classes/update-alternatives.bbclass b/meta/classes/update-alternatives.bbclass
index 45f4291aa2..2cadaf79e3 100644
--- a/meta/classes/update-alternatives.bbclass
+++ b/meta/classes/update-alternatives.bbclass
@@ -128,9 +128,9 @@ def update_alternatives_after_parse(d):
128 alt_path = d.getVar('ALTERNATIVE_PATH', True) 128 alt_path = d.getVar('ALTERNATIVE_PATH', True)
129 alt_link = d.getVar('ALTERNATIVE_LINK', True) or ("%s/%s" % (d.getVar('bindir', True), alt_name)) 129 alt_link = d.getVar('ALTERNATIVE_LINK', True) or ("%s/%s" % (d.getVar('bindir', True), alt_name))
130 if alt_name == None: 130 if alt_name == None:
131 raise bb.build.build.FuncFailed, "%s inherits update-alternatives but doesn't set ALTERNATIVE_NAME" % d.getVar('FILE') 131 raise bb.build.build.FuncFailed("%s inherits update-alternatives but doesn't set ALTERNATIVE_NAME" % d.getVar('FILE'))
132 if alt_path == None: 132 if alt_path == None:
133 raise bb.build.build.FuncFailed, "%s inherits update-alternatives but doesn't set ALTERNATIVE_PATH" % d.getVar('FILE') 133 raise bb.build.build.FuncFailed("%s inherits update-alternatives but doesn't set ALTERNATIVE_PATH" % d.getVar('FILE'))
134 134
135 alternative = d.getVar('ALTERNATIVE_%s' % pn, True) or "" 135 alternative = d.getVar('ALTERNATIVE_%s' % pn, True) or ""
136 alternative += " " + alt_name 136 alternative += " " + alt_name
diff --git a/meta/classes/update-rc.d.bbclass b/meta/classes/update-rc.d.bbclass
index d8cc34234e..55885698ae 100644
--- a/meta/classes/update-rc.d.bbclass
+++ b/meta/classes/update-rc.d.bbclass
@@ -44,9 +44,9 @@ fi
44def update_rc_after_parse(d): 44def update_rc_after_parse(d):
45 if d.getVar('INITSCRIPT_PACKAGES') == None: 45 if d.getVar('INITSCRIPT_PACKAGES') == None:
46 if d.getVar('INITSCRIPT_NAME') == None: 46 if d.getVar('INITSCRIPT_NAME') == None:
47 raise bb.build.FuncFailed, "%s inherits update-rc.d but doesn't set INITSCRIPT_NAME" % d.getVar('FILE') 47 raise bb.build.FuncFailed("%s inherits update-rc.d but doesn't set INITSCRIPT_NAME" % d.getVar('FILE'))
48 if d.getVar('INITSCRIPT_PARAMS') == None: 48 if d.getVar('INITSCRIPT_PARAMS') == None:
49 raise bb.build.FuncFailed, "%s inherits update-rc.d but doesn't set INITSCRIPT_PARAMS" % d.getVar('FILE') 49 raise bb.build.FuncFailed("%s inherits update-rc.d but doesn't set INITSCRIPT_PARAMS" % d.getVar('FILE'))
50 50
51python __anonymous() { 51python __anonymous() {
52 update_rc_after_parse(d) 52 update_rc_after_parse(d)
diff --git a/meta/classes/useradd.bbclass b/meta/classes/useradd.bbclass
index 0a4febadc8..52c0ba4ec1 100644
--- a/meta/classes/useradd.bbclass
+++ b/meta/classes/useradd.bbclass
@@ -157,11 +157,11 @@ def update_useradd_after_parse(d):
157 useradd_packages = d.getVar('USERADD_PACKAGES', True) 157 useradd_packages = d.getVar('USERADD_PACKAGES', True)
158 158
159 if not useradd_packages: 159 if not useradd_packages:
160 raise bb.build.FuncFailed, "%s inherits useradd but doesn't set USERADD_PACKAGES" % d.getVar('FILE') 160 raise bb.build.FuncFailed("%s inherits useradd but doesn't set USERADD_PACKAGES" % d.getVar('FILE'))
161 161
162 for pkg in useradd_packages.split(): 162 for pkg in useradd_packages.split():
163 if not d.getVar('USERADD_PARAM_%s' % pkg, True) and not d.getVar('GROUPADD_PARAM_%s' % pkg, True): 163 if not d.getVar('USERADD_PARAM_%s' % pkg, True) and not d.getVar('GROUPADD_PARAM_%s' % pkg, True):
164 raise bb.build.FuncFailed, "%s inherits useradd but doesn't set USERADD_PARAM or GROUPADD_PARAM for package %s" % (d.getVar('FILE'), pkg) 164 raise bb.build.FuncFailed("%s inherits useradd but doesn't set USERADD_PARAM or GROUPADD_PARAM for package %s" % (d.getVar('FILE'), pkg))
165 165
166python __anonymous() { 166python __anonymous() {
167 update_useradd_after_parse(d) 167 update_useradd_after_parse(d)