* [PATCH 01/22] base.bbclass: Use bb.fatal() instead of raising FuncFailed
2016-10-01 2:46 [PATCH 00/22] Use bb.fatal() instead of raising FuncFailed Ulf Magnusson
@ 2016-10-01 2:46 ` Ulf Magnusson
2016-10-01 2:46 ` [PATCH 02/22] package_ipk.bbclass: " Ulf Magnusson
` (20 subsequent siblings)
21 siblings, 0 replies; 26+ messages in thread
From: Ulf Magnusson @ 2016-10-01 2:46 UTC (permalink / raw)
To: openembedded-core
This sets a good example and avoids unnecessarily contributing to
perceived complexity and cargo culting.
Motivating quote below:
< kergoth> the *original* intent was for the function/task to error via
whatever appropriate means, bb.fatal, whatever, and
funcfailed was what you'd catch if you were calling
exec_func/exec_task. that is, it's what those functions
raise, not what metadata functions should be raising
< kergoth> it didn't end up being used that way
< kergoth> but there's really never a reason to raise it yourself
FuncFailed.__init__ takes a 'name' argument rather than a 'msg'
argument, which also shows that the original purpose got lost.
Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
---
meta/classes/base.bbclass | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index 21957d8..024fe43 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -113,7 +113,7 @@ def get_lic_checksum_file_list(d):
continue
filelist.append(path + ":" + str(os.path.exists(path)))
except bb.fetch.MalformedUrl:
- raise bb.build.FuncFailed(d.getVar('PN', True) + ": LIC_FILES_CHKSUM contains an invalid URL: " + url)
+ bb.fatal(d.getVar('PN', True) + ": LIC_FILES_CHKSUM contains an invalid URL: " + url)
return " ".join(filelist)
addtask fetch
@@ -131,7 +131,7 @@ python base_do_fetch() {
fetcher = bb.fetch2.Fetch(src_uri, d)
fetcher.download()
except bb.fetch2.BBFetchException as e:
- raise bb.build.FuncFailed(e)
+ bb.fatal(str(e))
}
addtask unpack after do_fetch
@@ -152,7 +152,7 @@ python base_do_unpack() {
fetcher = bb.fetch2.Fetch(src_uri, d)
fetcher.unpack(d.getVar('WORKDIR', True))
except bb.fetch2.BBFetchException as e:
- raise bb.build.FuncFailed(e)
+ bb.fatal(str(e))
}
def pkgarch_mapping(d):
@@ -671,7 +671,7 @@ python do_cleanall() {
fetcher = bb.fetch2.Fetch(src_uri, d)
fetcher.clean()
except bb.fetch2.BBFetchException as e:
- raise bb.build.FuncFailed(e)
+ bb.fatal(str(e))
}
do_cleanall[nostamp] = "1"
--
2.7.4
^ permalink raw reply related [flat|nested] 26+ messages in thread* [PATCH 02/22] package_ipk.bbclass: Use bb.fatal() instead of raising FuncFailed
2016-10-01 2:46 [PATCH 00/22] Use bb.fatal() instead of raising FuncFailed Ulf Magnusson
2016-10-01 2:46 ` [PATCH 01/22] base.bbclass: " Ulf Magnusson
@ 2016-10-01 2:46 ` Ulf Magnusson
2016-10-01 2:46 ` [PATCH 03/22] package_deb.bbclass: " Ulf Magnusson
` (19 subsequent siblings)
21 siblings, 0 replies; 26+ messages in thread
From: Ulf Magnusson @ 2016-10-01 2:46 UTC (permalink / raw)
To: openembedded-core
This sets a good example and avoids unnecessarily contributing to
perceived complexity and cargo culting.
Motivating quote below:
< kergoth> the *original* intent was for the function/task to error via
whatever appropriate means, bb.fatal, whatever, and
funcfailed was what you'd catch if you were calling
exec_func/exec_task. that is, it's what those functions
raise, not what metadata functions should be raising
< kergoth> it didn't end up being used that way
< kergoth> but there's really never a reason to raise it yourself
FuncFailed.__init__ takes a 'name' argument rather than a 'msg'
argument, which also shows that the original purpose got lost.
Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
---
meta/classes/package_ipk.bbclass | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/meta/classes/package_ipk.bbclass b/meta/classes/package_ipk.bbclass
index 930e154..eb00932 100644
--- a/meta/classes/package_ipk.bbclass
+++ b/meta/classes/package_ipk.bbclass
@@ -108,7 +108,7 @@ python do_package_ipk () {
ctrlfile = open(os.path.join(controldir, 'control'), 'w')
except OSError:
bb.utils.unlockfile(lf)
- raise bb.build.FuncFailed("unable to open control file for writing.")
+ bb.fatal("unable to open control file for writing")
fields = []
pe = d.getVar('PKGE', True)
@@ -162,7 +162,7 @@ python do_package_ipk () {
(type, value, traceback) = sys.exc_info()
ctrlfile.close()
bb.utils.unlockfile(lf)
- raise bb.build.FuncFailed("Missing field for ipk generation: %s" % value)
+ bb.fatal("Missing field for ipk generation: %s" % value)
# more fields
custom_fields_chunk = get_package_additional_metadata("ipk", localdata)
@@ -226,7 +226,7 @@ python do_package_ipk () {
scriptfile = open(os.path.join(controldir, script), 'w')
except OSError:
bb.utils.unlockfile(lf)
- raise bb.build.FuncFailed("unable to open %s script file for writing." % script)
+ bb.fatal("unable to open %s script file for writing" % script)
scriptfile.write(scriptvar)
scriptfile.close()
os.chmod(os.path.join(controldir, script), 0o755)
@@ -237,7 +237,7 @@ python do_package_ipk () {
conffiles = open(os.path.join(controldir, 'conffiles'), 'w')
except OSError:
bb.utils.unlockfile(lf)
- raise bb.build.FuncFailed("unable to open conffiles for writing.")
+ bb.fatal("unable to open conffiles for writing")
for f in conffiles_str.split():
if os.path.exists(oe.path.join(root, f)):
conffiles.write('%s\n' % f)
@@ -248,7 +248,7 @@ python do_package_ipk () {
d.getVar("OPKGBUILDCMD", True), pkg, pkgoutdir), shell=True)
if ret != 0:
bb.utils.unlockfile(lf)
- raise bb.build.FuncFailed("opkg-build execution failed")
+ bb.fatal("opkg-build execution failed")
if d.getVar('IPK_SIGN_PACKAGES', True) == '1':
ipkver = "%s-%s" % (d.getVar('PKGV', True), d.getVar('PKGR', True))
--
2.7.4
^ permalink raw reply related [flat|nested] 26+ messages in thread* [PATCH 03/22] package_deb.bbclass: Use bb.fatal() instead of raising FuncFailed
2016-10-01 2:46 [PATCH 00/22] Use bb.fatal() instead of raising FuncFailed Ulf Magnusson
2016-10-01 2:46 ` [PATCH 01/22] base.bbclass: " Ulf Magnusson
2016-10-01 2:46 ` [PATCH 02/22] package_ipk.bbclass: " Ulf Magnusson
@ 2016-10-01 2:46 ` Ulf Magnusson
2016-10-01 2:46 ` [PATCH 04/22] package_rpm.bbclass: " Ulf Magnusson
` (18 subsequent siblings)
21 siblings, 0 replies; 26+ messages in thread
From: Ulf Magnusson @ 2016-10-01 2:46 UTC (permalink / raw)
To: openembedded-core
This sets a good example and avoids unnecessarily contributing to
perceived complexity and cargo culting.
Motivating quote below:
< kergoth> the *original* intent was for the function/task to error via
whatever appropriate means, bb.fatal, whatever, and
funcfailed was what you'd catch if you were calling
exec_func/exec_task. that is, it's what those functions
raise, not what metadata functions should be raising
< kergoth> it didn't end up being used that way
< kergoth> but there's really never a reason to raise it yourself
FuncFailed.__init__ takes a 'name' argument rather than a 'msg'
argument, which also shows that the original purpose got lost.
Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
---
meta/classes/package_deb.bbclass | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/meta/classes/package_deb.bbclass b/meta/classes/package_deb.bbclass
index 4e5dc12..fb6034c 100644
--- a/meta/classes/package_deb.bbclass
+++ b/meta/classes/package_deb.bbclass
@@ -126,7 +126,7 @@ python do_package_deb () {
ctrlfile = codecs.open(os.path.join(controldir, 'control'), 'w', 'utf-8')
except OSError:
bb.utils.unlockfile(lf)
- raise bb.build.FuncFailed("unable to open control file for writing.")
+ bb.fatal("unable to open control file for writing")
fields = []
pe = d.getVar('PKGE', True)
@@ -197,7 +197,7 @@ python do_package_deb () {
(type, value, traceback) = sys.exc_info()
bb.utils.unlockfile(lf)
ctrlfile.close()
- raise bb.build.FuncFailed("Missing field for deb generation: %s" % value)
+ bb.fatal("Missing field for deb generation: %s" % value)
# more fields
@@ -277,7 +277,7 @@ python do_package_deb () {
scriptfile = open(os.path.join(controldir, script), 'w')
except OSError:
bb.utils.unlockfile(lf)
- raise bb.build.FuncFailed("unable to open %s script file for writing." % script)
+ bb.fatal("unable to open %s script file for writing" % script)
if scriptvar.startswith("#!"):
pos = scriptvar.find("\n") + 1
@@ -301,7 +301,7 @@ python do_package_deb () {
conffiles = open(os.path.join(controldir, 'conffiles'), 'w')
except OSError:
bb.utils.unlockfile(lf)
- raise bb.build.FuncFailed("unable to open conffiles for writing.")
+ bb.fatal("unable to open conffiles for writing")
for f in conffiles_str.split():
if os.path.exists(oe.path.join(root, f)):
conffiles.write('%s\n' % f)
@@ -311,7 +311,7 @@ python do_package_deb () {
ret = subprocess.call("PATH=\"%s\" dpkg-deb -b %s %s" % (localdata.getVar("PATH", True), root, pkgoutdir), shell=True)
if ret != 0:
bb.utils.unlockfile(lf)
- raise bb.build.FuncFailed("dpkg-deb execution failed")
+ bb.fatal("dpkg-deb execution failed")
cleanupcontrol(root)
bb.utils.unlockfile(lf)
--
2.7.4
^ permalink raw reply related [flat|nested] 26+ messages in thread* [PATCH 04/22] package_rpm.bbclass: Use bb.fatal() instead of raising FuncFailed
2016-10-01 2:46 [PATCH 00/22] Use bb.fatal() instead of raising FuncFailed Ulf Magnusson
` (2 preceding siblings ...)
2016-10-01 2:46 ` [PATCH 03/22] package_deb.bbclass: " Ulf Magnusson
@ 2016-10-01 2:46 ` Ulf Magnusson
2016-10-01 2:46 ` [PATCH 05/22] useradd-staticids.bbclass: " Ulf Magnusson
` (17 subsequent siblings)
21 siblings, 0 replies; 26+ messages in thread
From: Ulf Magnusson @ 2016-10-01 2:46 UTC (permalink / raw)
To: openembedded-core
This sets a good example and avoids unnecessarily contributing to
perceived complexity and cargo culting.
Motivating quote below:
< kergoth> the *original* intent was for the function/task to error via
whatever appropriate means, bb.fatal, whatever, and
funcfailed was what you'd catch if you were calling
exec_func/exec_task. that is, it's what those functions
raise, not what metadata functions should be raising
< kergoth> it didn't end up being used that way
< kergoth> but there's really never a reason to raise it yourself
FuncFailed.__init__ takes a 'name' argument rather than a 'msg'
argument, which also shows that the original purpose got lost.
Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
---
meta/classes/package_rpm.bbclass | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass
index f9398a9..c431545 100644
--- a/meta/classes/package_rpm.bbclass
+++ b/meta/classes/package_rpm.bbclass
@@ -58,7 +58,7 @@ def write_rpm_perfiledata(srcname, d):
try:
dependsfile = open(outdepends, 'w')
except OSError:
- raise bb.build.FuncFailed("unable to open spec file for writing.")
+ bb.fatal("unable to open spec file for writing")
dump_filerdeps('RDEPENDS', dependsfile, d)
@@ -71,7 +71,7 @@ def write_rpm_perfiledata(srcname, d):
try:
providesfile = open(outprovides, 'w')
except OSError:
- raise bb.build.FuncFailed("unable to open spec file for writing.")
+ bb.fatal("unable to open spec file for writing")
dump_filerdeps('RPROVIDES', providesfile, d)
@@ -617,7 +617,7 @@ python write_specfile () {
try:
specfile = open(outspecfile, 'w')
except OSError:
- raise bb.build.FuncFailed("unable to open spec file for writing.")
+ bb.fatal("unable to open spec file for writing")
# RPMSPEC_PREAMBLE is a way to add arbitrary text to the top
# of the generated spec file
--
2.7.4
^ permalink raw reply related [flat|nested] 26+ messages in thread* [PATCH 05/22] useradd-staticids.bbclass: Use bb.fatal() instead of raising FuncFailed
2016-10-01 2:46 [PATCH 00/22] Use bb.fatal() instead of raising FuncFailed Ulf Magnusson
` (3 preceding siblings ...)
2016-10-01 2:46 ` [PATCH 04/22] package_rpm.bbclass: " Ulf Magnusson
@ 2016-10-01 2:46 ` Ulf Magnusson
2016-10-01 2:46 ` [PATCH 06/22] grub-efi.bbclass: " Ulf Magnusson
` (16 subsequent siblings)
21 siblings, 0 replies; 26+ messages in thread
From: Ulf Magnusson @ 2016-10-01 2:46 UTC (permalink / raw)
To: openembedded-core
This sets a good example and avoids unnecessarily contributing to
perceived complexity and cargo culting.
Motivating quote below:
< kergoth> the *original* intent was for the function/task to error via
whatever appropriate means, bb.fatal, whatever, and
funcfailed was what you'd catch if you were calling
exec_func/exec_task. that is, it's what those functions
raise, not what metadata functions should be raising
< kergoth> it didn't end up being used that way
< kergoth> but there's really never a reason to raise it yourself
FuncFailed.__init__ takes a 'name' argument rather than a 'msg'
argument, which also shows that the original purpose got lost.
Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
---
meta/classes/useradd-staticids.bbclass | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/meta/classes/useradd-staticids.bbclass b/meta/classes/useradd-staticids.bbclass
index 46d4a4b..afb580a 100644
--- a/meta/classes/useradd-staticids.bbclass
+++ b/meta/classes/useradd-staticids.bbclass
@@ -16,7 +16,7 @@ def update_useradd_static_config(d):
error(message)
def error(self, message):
- raise bb.build.FuncFailed(message)
+ bb.fatal(message)
def list_extend(iterable, length, obj = None):
"""Ensure that iterable is the specified length by extending with obj
@@ -54,7 +54,7 @@ def update_useradd_static_config(d):
# For backwards compatibility we accept "1" in addition to "error"
if d.getVar('USERADD_ERROR_DYNAMIC', True) == 'error' or d.getVar('USERADD_ERROR_DYNAMIC', True) == '1':
#bb.error("Skipping recipe %s, package %s which adds %sname %s does not have a static ID defined." % (d.getVar('PN', True), pkg, type, id))
- raise bb.build.FuncFailed("%s - %s: %sname %s does not have a static ID defined." % (d.getVar('PN', True), pkg, type, id))
+ bb.fatal("%s - %s: %sname %s does not have a static ID defined." % (d.getVar('PN', True), pkg, type, id))
elif d.getVar('USERADD_ERROR_DYNAMIC', True) == 'warn':
bb.warn("%s - %s: %sname %s does not have a static ID defined." % (d.getVar('PN', True), pkg, type, id))
@@ -107,7 +107,7 @@ def update_useradd_static_config(d):
try:
uaargs = parser.parse_args(re.split('''[ \t]+(?=(?:[^'"]|'[^']*'|"[^"]*")*$)''', param))
except:
- raise bb.build.FuncFailed("%s: Unable to parse arguments for USERADD_PARAM_%s: '%s'" % (d.getVar('PN', True), pkg, param))
+ bb.fatal("%s: Unable to parse arguments for USERADD_PARAM_%s: '%s'" % (d.getVar('PN', True), pkg, param))
# Read all passwd files specified in USERADD_UID_TABLES or files/passwd
# Use the standard passwd layout:
@@ -242,7 +242,7 @@ def update_useradd_static_config(d):
# If we're processing multiple lines, we could have left over values here...
gaargs = parser.parse_args(re.split('''[ \t]+(?=(?:[^'"]|'[^']*'|"[^"]*")*$)''', param))
except:
- raise bb.build.FuncFailed("%s: Unable to parse arguments for GROUPADD_PARAM_%s: '%s'" % (d.getVar('PN', True), pkg, param))
+ bb.fatal("%s: Unable to parse arguments for GROUPADD_PARAM_%s: '%s'" % (d.getVar('PN', True), pkg, param))
# Read all group files specified in USERADD_GID_TABLES or files/group
# Use the standard group layout:
--
2.7.4
^ permalink raw reply related [flat|nested] 26+ messages in thread* [PATCH 06/22] grub-efi.bbclass: Use bb.fatal() instead of raising FuncFailed
2016-10-01 2:46 [PATCH 00/22] Use bb.fatal() instead of raising FuncFailed Ulf Magnusson
` (4 preceding siblings ...)
2016-10-01 2:46 ` [PATCH 05/22] useradd-staticids.bbclass: " Ulf Magnusson
@ 2016-10-01 2:46 ` Ulf Magnusson
2016-10-01 2:46 ` [PATCH 07/22] syslinux.bbclass: " Ulf Magnusson
` (15 subsequent siblings)
21 siblings, 0 replies; 26+ messages in thread
From: Ulf Magnusson @ 2016-10-01 2:46 UTC (permalink / raw)
To: openembedded-core
This sets a good example and avoids unnecessarily contributing to
perceived complexity and cargo culting.
Motivating quote below:
< kergoth> the *original* intent was for the function/task to error via
whatever appropriate means, bb.fatal, whatever, and
funcfailed was what you'd catch if you were calling
exec_func/exec_task. that is, it's what those functions
raise, not what metadata functions should be raising
< kergoth> it didn't end up being used that way
< kergoth> but there's really never a reason to raise it yourself
FuncFailed.__init__ takes a 'name' argument rather than a 'msg'
argument, which also shows that the original purpose got lost.
Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
---
meta/classes/grub-efi.bbclass | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/meta/classes/grub-efi.bbclass b/meta/classes/grub-efi.bbclass
index 26ba8ce..17417ba 100644
--- a/meta/classes/grub-efi.bbclass
+++ b/meta/classes/grub-efi.bbclass
@@ -90,12 +90,12 @@ python build_efi_cfg() {
cfile = d.getVar('GRUB_CFG', True)
if not cfile:
- raise bb.build.FuncFailed('Unable to read GRUB_CFG')
+ bb.fatal('Unable to read GRUB_CFG')
try:
cfgfile = open(cfile, 'w')
except OSError:
- raise bb.build.FuncFailed('Unable to open %s' % (cfile))
+ bb.fatal('Unable to open %s' % cfile)
cfgfile.write('# Automatically created by OE\n')
@@ -114,7 +114,7 @@ python build_efi_cfg() {
root = d.getVar('GRUB_ROOT', True)
if not root:
- raise bb.build.FuncFailed('GRUB_ROOT not defined')
+ bb.fatal('GRUB_ROOT not defined')
if gfxserial == "1":
btypes = [ [ " graphics console", "" ],
@@ -127,7 +127,7 @@ python build_efi_cfg() {
overrides = localdata.getVar('OVERRIDES', True)
if not overrides:
- raise bb.build.FuncFailed('OVERRIDES not defined')
+ bb.fatal('OVERRIDES not defined')
for btype in btypes:
localdata.setVar('OVERRIDES', label + ':' + overrides)
--
2.7.4
^ permalink raw reply related [flat|nested] 26+ messages in thread* [PATCH 07/22] syslinux.bbclass: Use bb.fatal() instead of raising FuncFailed
2016-10-01 2:46 [PATCH 00/22] Use bb.fatal() instead of raising FuncFailed Ulf Magnusson
` (5 preceding siblings ...)
2016-10-01 2:46 ` [PATCH 06/22] grub-efi.bbclass: " Ulf Magnusson
@ 2016-10-01 2:46 ` Ulf Magnusson
2016-10-01 2:46 ` [PATCH 08/22] systemd-boot.bbclass: " Ulf Magnusson
` (14 subsequent siblings)
21 siblings, 0 replies; 26+ messages in thread
From: Ulf Magnusson @ 2016-10-01 2:46 UTC (permalink / raw)
To: openembedded-core
This sets a good example and avoids unnecessarily contributing to
perceived complexity and cargo culting.
Motivating quote below:
< kergoth> the *original* intent was for the function/task to error via
whatever appropriate means, bb.fatal, whatever, and
funcfailed was what you'd catch if you were calling
exec_func/exec_task. that is, it's what those functions
raise, not what metadata functions should be raising
< kergoth> it didn't end up being used that way
< kergoth> but there's really never a reason to raise it yourself
FuncFailed.__init__ takes a 'name' argument rather than a 'msg'
argument, which also shows that the original purpose got lost.
Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
---
meta/classes/syslinux.bbclass | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/meta/classes/syslinux.bbclass b/meta/classes/syslinux.bbclass
index 9b0c2c7..7778fd7 100644
--- a/meta/classes/syslinux.bbclass
+++ b/meta/classes/syslinux.bbclass
@@ -100,12 +100,12 @@ python build_syslinux_cfg () {
cfile = d.getVar('SYSLINUX_CFG', True)
if not cfile:
- raise bb.build.FuncFailed('Unable to read SYSLINUX_CFG')
+ bb.fatal('Unable to read SYSLINUX_CFG')
try:
cfgfile = open(cfile, 'w')
except OSError:
- raise bb.build.FuncFailed('Unable to open %s' % (cfile))
+ bb.fatal('Unable to open %s' % cfile)
cfgfile.write('# Automatically created by OE\n')
@@ -160,7 +160,7 @@ python build_syslinux_cfg () {
overrides = localdata.getVar('OVERRIDES', True)
if not overrides:
- raise bb.build.FuncFailed('OVERRIDES not defined')
+ bb.fatal('OVERRIDES not defined')
localdata.setVar('OVERRIDES', label + ':' + overrides)
bb.data.update_data(localdata)
@@ -172,7 +172,7 @@ python build_syslinux_cfg () {
root= d.getVar('SYSLINUX_ROOT', True)
if not root:
- raise bb.build.FuncFailed('SYSLINUX_ROOT not defined')
+ bb.fatal('SYSLINUX_ROOT not defined')
for btype in btypes:
cfgfile.write('LABEL %s%s\nKERNEL /vmlinuz\n' % (btype[0], label))
--
2.7.4
^ permalink raw reply related [flat|nested] 26+ messages in thread* [PATCH 08/22] systemd-boot.bbclass: Use bb.fatal() instead of raising FuncFailed
2016-10-01 2:46 [PATCH 00/22] Use bb.fatal() instead of raising FuncFailed Ulf Magnusson
` (6 preceding siblings ...)
2016-10-01 2:46 ` [PATCH 07/22] syslinux.bbclass: " Ulf Magnusson
@ 2016-10-01 2:46 ` Ulf Magnusson
2016-10-01 2:46 ` [PATCH 09/22] gummiboot.bbclass: " Ulf Magnusson
` (13 subsequent siblings)
21 siblings, 0 replies; 26+ messages in thread
From: Ulf Magnusson @ 2016-10-01 2:46 UTC (permalink / raw)
To: openembedded-core
This sets a good example and avoids unnecessarily contributing to
perceived complexity and cargo culting.
Motivating quote below:
< kergoth> the *original* intent was for the function/task to error via
whatever appropriate means, bb.fatal, whatever, and
funcfailed was what you'd catch if you were calling
exec_func/exec_task. that is, it's what those functions
raise, not what metadata functions should be raising
< kergoth> it didn't end up being used that way
< kergoth> but there's really never a reason to raise it yourself
FuncFailed.__init__ takes a 'name' argument rather than a 'msg'
argument, which also shows that the original purpose got lost.
Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
---
meta/classes/systemd-boot.bbclass | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/meta/classes/systemd-boot.bbclass b/meta/classes/systemd-boot.bbclass
index b550b61..05244c7 100644
--- a/meta/classes/systemd-boot.bbclass
+++ b/meta/classes/systemd-boot.bbclass
@@ -77,7 +77,7 @@ python build_efi_cfg() {
try:
cfgfile = open(cfile, 'w')
except OSError:
- raise bb.build.FuncFailed('Unable to open %s' % (cfile))
+ bb.fatal('Unable to open %s' % cfile)
cfgfile.write('# Automatically created by OE\n')
cfgfile.write('default %s\n' % (labels.split()[0]))
@@ -93,14 +93,14 @@ python build_efi_cfg() {
overrides = localdata.getVar('OVERRIDES', True)
if not overrides:
- raise bb.build.FuncFailed('OVERRIDES not defined')
+ bb.fatal('OVERRIDES not defined')
entryfile = "%s/%s.conf" % (s, label)
d.appendVar("SYSTEMD_BOOT_ENTRIES", " " + entryfile)
try:
entrycfg = open(entryfile, "w")
except OSError:
- raise bb.build.FuncFailed('Unable to open %s' % (entryfile))
+ bb.fatal('Unable to open %s' % entryfile)
localdata.setVar('OVERRIDES', label + ':' + overrides)
bb.data.update_data(localdata)
--
2.7.4
^ permalink raw reply related [flat|nested] 26+ messages in thread* [PATCH 09/22] gummiboot.bbclass: Use bb.fatal() instead of raising FuncFailed
2016-10-01 2:46 [PATCH 00/22] Use bb.fatal() instead of raising FuncFailed Ulf Magnusson
` (7 preceding siblings ...)
2016-10-01 2:46 ` [PATCH 08/22] systemd-boot.bbclass: " Ulf Magnusson
@ 2016-10-01 2:46 ` Ulf Magnusson
2016-10-01 2:46 ` [PATCH 10/22] update-rc.d.bbclass: " Ulf Magnusson
` (12 subsequent siblings)
21 siblings, 0 replies; 26+ messages in thread
From: Ulf Magnusson @ 2016-10-01 2:46 UTC (permalink / raw)
To: openembedded-core
This sets a good example and avoids unnecessarily contributing to
perceived complexity and cargo culting.
Motivating quote below:
< kergoth> the *original* intent was for the function/task to error via
whatever appropriate means, bb.fatal, whatever, and
funcfailed was what you'd catch if you were calling
exec_func/exec_task. that is, it's what those functions
raise, not what metadata functions should be raising
< kergoth> it didn't end up being used that way
< kergoth> but there's really never a reason to raise it yourself
FuncFailed.__init__ takes a 'name' argument rather than a 'msg'
argument, which also shows that the original purpose got lost.
Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
---
meta/classes/gummiboot.bbclass | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/meta/classes/gummiboot.bbclass b/meta/classes/gummiboot.bbclass
index e6eba17..4f2dea6 100644
--- a/meta/classes/gummiboot.bbclass
+++ b/meta/classes/gummiboot.bbclass
@@ -74,7 +74,7 @@ python build_efi_cfg() {
try:
cfgfile = open(cfile, 'w')
except OSError:
- raise bb.build.FuncFailed('Unable to open %s' % (cfile))
+ bb.fatal('Unable to open %s' % cfile)
cfgfile.write('# Automatically created by OE\n')
cfgfile.write('default %s\n' % (labels.split()[0]))
@@ -90,14 +90,14 @@ python build_efi_cfg() {
overrides = localdata.getVar('OVERRIDES', True)
if not overrides:
- raise bb.build.FuncFailed('OVERRIDES not defined')
+ bb.fatal('OVERRIDES not defined')
entryfile = "%s/%s.conf" % (s, label)
d.appendVar("GUMMIBOOT_ENTRIES", " " + entryfile)
try:
entrycfg = open(entryfile, "w")
except OSError:
- raise bb.build.FuncFailed('Unable to open %s' % (entryfile))
+ bb.fatal('Unable to open %s' % entryfile)
localdata.setVar('OVERRIDES', label + ':' + overrides)
bb.data.update_data(localdata)
--
2.7.4
^ permalink raw reply related [flat|nested] 26+ messages in thread* [PATCH 10/22] update-rc.d.bbclass: Use bb.fatal() instead of raising FuncFailed
2016-10-01 2:46 [PATCH 00/22] Use bb.fatal() instead of raising FuncFailed Ulf Magnusson
` (8 preceding siblings ...)
2016-10-01 2:46 ` [PATCH 09/22] gummiboot.bbclass: " Ulf Magnusson
@ 2016-10-01 2:46 ` Ulf Magnusson
2016-10-01 2:47 ` [PATCH 11/22] license.bbclass: " Ulf Magnusson
` (11 subsequent siblings)
21 siblings, 0 replies; 26+ messages in thread
From: Ulf Magnusson @ 2016-10-01 2:46 UTC (permalink / raw)
To: openembedded-core
This sets a good example and avoids unnecessarily contributing to
perceived complexity and cargo culting.
Motivating quote below:
< kergoth> the *original* intent was for the function/task to error via
whatever appropriate means, bb.fatal, whatever, and
funcfailed was what you'd catch if you were calling
exec_func/exec_task. that is, it's what those functions
raise, not what metadata functions should be raising
< kergoth> it didn't end up being used that way
< kergoth> but there's really never a reason to raise it yourself
FuncFailed.__init__ takes a 'name' argument rather than a 'msg'
argument, which also shows that the original purpose got lost.
Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
---
meta/classes/update-rc.d.bbclass | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/meta/classes/update-rc.d.bbclass b/meta/classes/update-rc.d.bbclass
index 82b8024..dfef2a2 100644
--- a/meta/classes/update-rc.d.bbclass
+++ b/meta/classes/update-rc.d.bbclass
@@ -57,9 +57,9 @@ fi
def update_rc_after_parse(d):
if d.getVar('INITSCRIPT_PACKAGES', False) == None:
if d.getVar('INITSCRIPT_NAME', False) == None:
- raise bb.build.FuncFailed("%s inherits update-rc.d but doesn't set INITSCRIPT_NAME" % d.getVar('FILE', False))
+ bb.fatal("%s inherits update-rc.d but doesn't set INITSCRIPT_NAME" % d.getVar('FILE', False))
if d.getVar('INITSCRIPT_PARAMS', False) == None:
- raise bb.build.FuncFailed("%s inherits update-rc.d but doesn't set INITSCRIPT_PARAMS" % d.getVar('FILE', False))
+ bb.fatal("%s inherits update-rc.d but doesn't set INITSCRIPT_PARAMS" % d.getVar('FILE', False))
python __anonymous() {
update_rc_after_parse(d)
--
2.7.4
^ permalink raw reply related [flat|nested] 26+ messages in thread* [PATCH 11/22] license.bbclass: Use bb.fatal() instead of raising FuncFailed
2016-10-01 2:46 [PATCH 00/22] Use bb.fatal() instead of raising FuncFailed Ulf Magnusson
` (9 preceding siblings ...)
2016-10-01 2:46 ` [PATCH 10/22] update-rc.d.bbclass: " Ulf Magnusson
@ 2016-10-01 2:47 ` Ulf Magnusson
2016-10-01 2:47 ` [PATCH 12/22] systemd.bbclass: " Ulf Magnusson
` (10 subsequent siblings)
21 siblings, 0 replies; 26+ messages in thread
From: Ulf Magnusson @ 2016-10-01 2:47 UTC (permalink / raw)
To: openembedded-core
This sets a good example and avoids unnecessarily contributing to
perceived complexity and cargo culting.
Motivating quote below:
< kergoth> the *original* intent was for the function/task to error via
whatever appropriate means, bb.fatal, whatever, and
funcfailed was what you'd catch if you were calling
exec_func/exec_task. that is, it's what those functions
raise, not what metadata functions should be raising
< kergoth> it didn't end up being used that way
< kergoth> but there's really never a reason to raise it yourself
FuncFailed.__init__ takes a 'name' argument rather than a 'msg'
argument, which also shows that the original purpose got lost.
Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
---
meta/classes/license.bbclass | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/meta/classes/license.bbclass b/meta/classes/license.bbclass
index ad12db4..da4fc3e 100644
--- a/meta/classes/license.bbclass
+++ b/meta/classes/license.bbclass
@@ -465,7 +465,7 @@ def find_license_files(d):
pass
if not generic_directory:
- raise bb.build.FuncFailed("COMMON_LICENSE_DIR is unset. Please set this in your distro config")
+ bb.fatal("COMMON_LICENSE_DIR is unset. Please set this in your distro config")
if not lic_files:
# No recipe should have an invalid license file. This is checked else
@@ -477,7 +477,7 @@ def find_license_files(d):
try:
(type, host, path, user, pswd, parm) = bb.fetch.decodeurl(url)
except bb.fetch.MalformedUrl:
- raise bb.build.FuncFailed("%s: LIC_FILES_CHKSUM contains an invalid URL: %s" % (d.getVar('PF', True), url))
+ bb.fatal("%s: LIC_FILES_CHKSUM contains an invalid URL: %s" % (d.getVar('PF', True), url))
# We want the license filename and path
chksum = parm['md5'] if 'md5' in parm else parm['sha256']
lic_chksums[path] = chksum
--
2.7.4
^ permalink raw reply related [flat|nested] 26+ messages in thread* [PATCH 12/22] systemd.bbclass: Use bb.fatal() instead of raising FuncFailed
2016-10-01 2:46 [PATCH 00/22] Use bb.fatal() instead of raising FuncFailed Ulf Magnusson
` (10 preceding siblings ...)
2016-10-01 2:47 ` [PATCH 11/22] license.bbclass: " Ulf Magnusson
@ 2016-10-01 2:47 ` Ulf Magnusson
2016-10-01 2:47 ` [PATCH 13/22] gtk-immodules-cache.bbclass: " Ulf Magnusson
` (9 subsequent siblings)
21 siblings, 0 replies; 26+ messages in thread
From: Ulf Magnusson @ 2016-10-01 2:47 UTC (permalink / raw)
To: openembedded-core
This sets a good example and avoids unnecessarily contributing to
perceived complexity and cargo culting.
Motivating quote below:
< kergoth> the *original* intent was for the function/task to error via
whatever appropriate means, bb.fatal, whatever, and
funcfailed was what you'd catch if you were calling
exec_func/exec_task. that is, it's what those functions
raise, not what metadata functions should be raising
< kergoth> it didn't end up being used that way
< kergoth> but there's really never a reason to raise it yourself
FuncFailed.__init__ takes a 'name' argument rather than a 'msg'
argument, which also shows that the original purpose got lost.
Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
---
meta/classes/systemd.bbclass | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/meta/classes/systemd.bbclass b/meta/classes/systemd.bbclass
index db7873f..d56c760 100644
--- a/meta/classes/systemd.bbclass
+++ b/meta/classes/systemd.bbclass
@@ -165,8 +165,7 @@ python systemd_populate_packages() {
if path_found != '':
systemd_add_files_and_parse(pkg_systemd, path_found, service, keys)
else:
- raise bb.build.FuncFailed("SYSTEMD_SERVICE_%s value %s does not exist" % \
- (pkg_systemd, service))
+ bb.fatal("SYSTEMD_SERVICE_%s value %s does not exist" % (pkg_systemd, service))
# Run all modifications once when creating package
if os.path.exists(d.getVar("D", True)):
--
2.7.4
^ permalink raw reply related [flat|nested] 26+ messages in thread* [PATCH 13/22] gtk-immodules-cache.bbclass: Use bb.fatal() instead of raising FuncFailed
2016-10-01 2:46 [PATCH 00/22] Use bb.fatal() instead of raising FuncFailed Ulf Magnusson
` (11 preceding siblings ...)
2016-10-01 2:47 ` [PATCH 12/22] systemd.bbclass: " Ulf Magnusson
@ 2016-10-01 2:47 ` Ulf Magnusson
2016-10-01 2:47 ` [PATCH 14/22] useradd.bbclass: " Ulf Magnusson
` (8 subsequent siblings)
21 siblings, 0 replies; 26+ messages in thread
From: Ulf Magnusson @ 2016-10-01 2:47 UTC (permalink / raw)
To: openembedded-core
This sets a good example and avoids unnecessarily contributing to
perceived complexity and cargo culting.
Motivating quote below:
< kergoth> the *original* intent was for the function/task to error via
whatever appropriate means, bb.fatal, whatever, and
funcfailed was what you'd catch if you were calling
exec_func/exec_task. that is, it's what those functions
raise, not what metadata functions should be raising
< kergoth> it didn't end up being used that way
< kergoth> but there's really never a reason to raise it yourself
FuncFailed.__init__ takes a 'name' argument rather than a 'msg'
argument, which also shows that the original purpose got lost.
Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
---
meta/classes/gtk-immodules-cache.bbclass | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meta/classes/gtk-immodules-cache.bbclass b/meta/classes/gtk-immodules-cache.bbclass
index 3a4634c..ebbc9de 100644
--- a/meta/classes/gtk-immodules-cache.bbclass
+++ b/meta/classes/gtk-immodules-cache.bbclass
@@ -84,6 +84,6 @@ python __anonymous() {
gtkimmodules_check = d.getVar('GTKIMMODULES_PACKAGES', False)
if not gtkimmodules_check:
bb_filename = d.getVar('FILE', False)
- raise bb.build.FuncFailed("ERROR: %s inherits gtk-immodules-cache but doesn't set GTKIMMODULES_PACKAGES" % bb_filename)
+ bb.fatal("ERROR: %s inherits gtk-immodules-cache but doesn't set GTKIMMODULES_PACKAGES" % bb_filename)
}
--
2.7.4
^ permalink raw reply related [flat|nested] 26+ messages in thread* [PATCH 14/22] useradd.bbclass: Use bb.fatal() instead of raising FuncFailed
2016-10-01 2:46 [PATCH 00/22] Use bb.fatal() instead of raising FuncFailed Ulf Magnusson
` (12 preceding siblings ...)
2016-10-01 2:47 ` [PATCH 13/22] gtk-immodules-cache.bbclass: " Ulf Magnusson
@ 2016-10-01 2:47 ` Ulf Magnusson
2016-10-01 2:47 ` [PATCH 15/22] sstate.bbclass: " Ulf Magnusson
` (7 subsequent siblings)
21 siblings, 0 replies; 26+ messages in thread
From: Ulf Magnusson @ 2016-10-01 2:47 UTC (permalink / raw)
To: openembedded-core
This sets a good example and avoids unnecessarily contributing to
perceived complexity and cargo culting.
Motivating quote below:
< kergoth> the *original* intent was for the function/task to error via
whatever appropriate means, bb.fatal, whatever, and
funcfailed was what you'd catch if you were calling
exec_func/exec_task. that is, it's what those functions
raise, not what metadata functions should be raising
< kergoth> it didn't end up being used that way
< kergoth> but there's really never a reason to raise it yourself
FuncFailed.__init__ takes a 'name' argument rather than a 'msg'
argument, which also shows that the original purpose got lost.
Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
---
meta/classes/useradd.bbclass | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meta/classes/useradd.bbclass b/meta/classes/useradd.bbclass
index bf62ada..3cff08e 100644
--- a/meta/classes/useradd.bbclass
+++ b/meta/classes/useradd.bbclass
@@ -171,7 +171,7 @@ def update_useradd_after_parse(d):
useradd_packages = d.getVar('USERADD_PACKAGES', True)
if not useradd_packages:
- raise bb.build.FuncFailed("%s inherits useradd but doesn't set USERADD_PACKAGES" % d.getVar('FILE', False))
+ bb.fatal("%s inherits useradd but doesn't set USERADD_PACKAGES" % d.getVar('FILE', False))
for pkg in useradd_packages.split():
if not d.getVar('USERADD_PARAM_%s' % pkg, True) and not d.getVar('GROUPADD_PARAM_%s' % pkg, True) and not d.getVar('GROUPMEMS_PARAM_%s' % pkg, True):
--
2.7.4
^ permalink raw reply related [flat|nested] 26+ messages in thread* [PATCH 15/22] sstate.bbclass: Use bb.fatal() instead of raising FuncFailed
2016-10-01 2:46 [PATCH 00/22] Use bb.fatal() instead of raising FuncFailed Ulf Magnusson
` (13 preceding siblings ...)
2016-10-01 2:47 ` [PATCH 14/22] useradd.bbclass: " Ulf Magnusson
@ 2016-10-01 2:47 ` Ulf Magnusson
2016-10-01 2:47 ` [PATCH 16/22] chrpath.bbclass: " Ulf Magnusson
` (6 subsequent siblings)
21 siblings, 0 replies; 26+ messages in thread
From: Ulf Magnusson @ 2016-10-01 2:47 UTC (permalink / raw)
To: openembedded-core
This sets a good example and avoids unnecessarily contributing to
perceived complexity and cargo culting.
Motivating quote below:
< kergoth> the *original* intent was for the function/task to error via
whatever appropriate means, bb.fatal, whatever, and
funcfailed was what you'd catch if you were calling
exec_func/exec_task. that is, it's what those functions
raise, not what metadata functions should be raising
< kergoth> it didn't end up being used that way
< kergoth> but there's really never a reason to raise it yourself
FuncFailed.__init__ takes a 'name' argument rather than a 'msg'
argument, which also shows that the original purpose got lost.
Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
---
meta/classes/sstate.bbclass | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass
index ac9d77d..6f0c791 100644
--- a/meta/classes/sstate.bbclass
+++ b/meta/classes/sstate.bbclass
@@ -658,7 +658,7 @@ def sstate_setscene(d):
shared_state = sstate_state_fromvars(d)
accelerate = sstate_installpkg(shared_state, d)
if not accelerate:
- raise bb.build.FuncFailed("No suitable staging package found")
+ bb.fatal("No suitable staging package found")
python sstate_task_prefunc () {
shared_state = sstate_state_fromvars(d)
--
2.7.4
^ permalink raw reply related [flat|nested] 26+ messages in thread* [PATCH 16/22] chrpath.bbclass: Use bb.fatal() instead of raising FuncFailed
2016-10-01 2:46 [PATCH 00/22] Use bb.fatal() instead of raising FuncFailed Ulf Magnusson
` (14 preceding siblings ...)
2016-10-01 2:47 ` [PATCH 15/22] sstate.bbclass: " Ulf Magnusson
@ 2016-10-01 2:47 ` Ulf Magnusson
2016-10-01 2:47 ` [PATCH 17/22] testsdk.bbclass: " Ulf Magnusson
` (5 subsequent siblings)
21 siblings, 0 replies; 26+ messages in thread
From: Ulf Magnusson @ 2016-10-01 2:47 UTC (permalink / raw)
To: openembedded-core
This sets a good example and avoids unnecessarily contributing to
perceived complexity and cargo culting.
Motivating quote below:
< kergoth> the *original* intent was for the function/task to error via
whatever appropriate means, bb.fatal, whatever, and
funcfailed was what you'd catch if you were calling
exec_func/exec_task. that is, it's what those functions
raise, not what metadata functions should be raising
< kergoth> it didn't end up being used that way
< kergoth> but there's really never a reason to raise it yourself
FuncFailed.__init__ takes a 'name' argument rather than a 'msg'
argument, which also shows that the original purpose got lost.
Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
---
meta/classes/chrpath.bbclass | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/meta/classes/chrpath.bbclass b/meta/classes/chrpath.bbclass
index 72e8a12..3b5cd37 100644
--- a/meta/classes/chrpath.bbclass
+++ b/meta/classes/chrpath.bbclass
@@ -39,8 +39,7 @@ def process_file_linux(cmd, fpath, rootdir, baseprefix, tmpdir, d):
p = sub.Popen([cmd, '-r', args, fpath],stdout=sub.PIPE,stderr=sub.PIPE)
out, err = p.communicate()
if p.returncode != 0:
- bb.error("%s: chrpath command failed with exit code %d:\n%s%s" % (d.getVar('PN', True), p.returncode, out, err))
- raise bb.build.FuncFailed
+ bb.fatal("%s: chrpath command failed with exit code %d:\n%s%s" % (d.getVar('PN', True), p.returncode, out, err))
def process_file_darwin(cmd, fpath, rootdir, baseprefix, tmpdir, d):
import subprocess as sub
--
2.7.4
^ permalink raw reply related [flat|nested] 26+ messages in thread* [PATCH 17/22] testsdk.bbclass: Use bb.fatal() instead of raising FuncFailed
2016-10-01 2:46 [PATCH 00/22] Use bb.fatal() instead of raising FuncFailed Ulf Magnusson
` (15 preceding siblings ...)
2016-10-01 2:47 ` [PATCH 16/22] chrpath.bbclass: " Ulf Magnusson
@ 2016-10-01 2:47 ` Ulf Magnusson
2016-10-01 2:47 ` [PATCH 18/22] libc-package.bbclass: " Ulf Magnusson
` (4 subsequent siblings)
21 siblings, 0 replies; 26+ messages in thread
From: Ulf Magnusson @ 2016-10-01 2:47 UTC (permalink / raw)
To: openembedded-core
This sets a good example and avoids unnecessarily contributing to
perceived complexity and cargo culting.
Motivating quote below:
< kergoth> the *original* intent was for the function/task to error via
whatever appropriate means, bb.fatal, whatever, and
funcfailed was what you'd catch if you were calling
exec_func/exec_task. that is, it's what those functions
raise, not what metadata functions should be raising
< kergoth> it didn't end up being used that way
< kergoth> but there's really never a reason to raise it yourself
FuncFailed.__init__ takes a 'name' argument rather than a 'msg'
argument, which also shows that the original purpose got lost.
Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
---
meta/classes/testsdk.bbclass | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meta/classes/testsdk.bbclass b/meta/classes/testsdk.bbclass
index 0b8716e..77c9203 100644
--- a/meta/classes/testsdk.bbclass
+++ b/meta/classes/testsdk.bbclass
@@ -44,7 +44,7 @@ def run_test_context(CTestContext, d, testdir, tcname, pn, *args):
msg += " (skipped=%d)" % skipped
bb.plain(msg)
else:
- raise bb.build.FuncFailed("%s - FAILED - check the task log and the commands log" % pn )
+ bb.fatal("%s - FAILED - check the task log and the commands log" % pn)
def testsdk_main(d):
import os
--
2.7.4
^ permalink raw reply related [flat|nested] 26+ messages in thread* [PATCH 18/22] libc-package.bbclass: Use bb.fatal() instead of raising FuncFailed
2016-10-01 2:46 [PATCH 00/22] Use bb.fatal() instead of raising FuncFailed Ulf Magnusson
` (16 preceding siblings ...)
2016-10-01 2:47 ` [PATCH 17/22] testsdk.bbclass: " Ulf Magnusson
@ 2016-10-01 2:47 ` Ulf Magnusson
2016-10-01 2:47 ` [PATCH 19/22] package.bbclass: " Ulf Magnusson
` (3 subsequent siblings)
21 siblings, 0 replies; 26+ messages in thread
From: Ulf Magnusson @ 2016-10-01 2:47 UTC (permalink / raw)
To: openembedded-core
This sets a good example and avoids unnecessarily contributing to
perceived complexity and cargo culting.
Motivating quote below:
< kergoth> the *original* intent was for the function/task to error via
whatever appropriate means, bb.fatal, whatever, and
funcfailed was what you'd catch if you were calling
exec_func/exec_task. that is, it's what those functions
raise, not what metadata functions should be raising
< kergoth> it didn't end up being used that way
< kergoth> but there's really never a reason to raise it yourself
FuncFailed.__init__ takes a 'name' argument rather than a 'msg'
argument, which also shows that the original purpose got lost.
Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
---
meta/classes/libc-package.bbclass | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meta/classes/libc-package.bbclass b/meta/classes/libc-package.bbclass
index 8c99d61..4d17ff9 100644
--- a/meta/classes/libc-package.bbclass
+++ b/meta/classes/libc-package.bbclass
@@ -260,7 +260,7 @@ python package_do_split_gconvs () {
localedef_opts = locale_arch_options[target_arch]
else:
bb.error("locale_arch_options not found for target_arch=" + target_arch)
- raise bb.build.FuncFailed("unknown arch:" + target_arch + " for locale_arch_options")
+ bb.fatal("unknown arch:" + target_arch + " for locale_arch_options")
localedef_opts += " --force --no-archive --prefix=%s \
--inputfile=%s/%s/i18n/locales/%s --charmap=%s %s/%s" \
--
2.7.4
^ permalink raw reply related [flat|nested] 26+ messages in thread* [PATCH 19/22] package.bbclass: Use bb.fatal() instead of raising FuncFailed
2016-10-01 2:46 [PATCH 00/22] Use bb.fatal() instead of raising FuncFailed Ulf Magnusson
` (17 preceding siblings ...)
2016-10-01 2:47 ` [PATCH 18/22] libc-package.bbclass: " Ulf Magnusson
@ 2016-10-01 2:47 ` Ulf Magnusson
2016-10-01 2:47 ` [PATCH 20/22] utility-tasks.bbclass: " Ulf Magnusson
` (2 subsequent siblings)
21 siblings, 0 replies; 26+ messages in thread
From: Ulf Magnusson @ 2016-10-01 2:47 UTC (permalink / raw)
To: openembedded-core
This sets a good example and avoids unnecessarily contributing to
perceived complexity and cargo culting.
Motivating quote below:
< kergoth> the *original* intent was for the function/task to error via
whatever appropriate means, bb.fatal, whatever, and
funcfailed was what you'd catch if you were calling
exec_func/exec_task. that is, it's what those functions
raise, not what metadata functions should be raising
< kergoth> it didn't end up being used that way
< kergoth> but there's really never a reason to raise it yourself
FuncFailed.__init__ takes a 'name' argument rather than a 'msg'
argument, which also shows that the original purpose got lost.
Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
---
meta/classes/package.bbclass | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index a9ca141..a6f0a7a 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -1171,7 +1171,7 @@ python populate_packages () {
continue
ret = bb.utils.copyfile(file, fpath)
if ret is False or ret == 0:
- raise bb.build.FuncFailed("File population failed")
+ bb.fatal("File population failed")
# Check if symlink paths exist
for file in symlink_paths:
--
2.7.4
^ permalink raw reply related [flat|nested] 26+ messages in thread* [PATCH 20/22] utility-tasks.bbclass: Use bb.fatal() instead of raising FuncFailed
2016-10-01 2:46 [PATCH 00/22] Use bb.fatal() instead of raising FuncFailed Ulf Magnusson
` (18 preceding siblings ...)
2016-10-01 2:47 ` [PATCH 19/22] package.bbclass: " Ulf Magnusson
@ 2016-10-01 2:47 ` Ulf Magnusson
2016-10-01 2:47 ` [PATCH 21/22] testimage.bbclass: " Ulf Magnusson
2016-10-01 2:47 ` [PATCH 22/22] cmake: " Ulf Magnusson
21 siblings, 0 replies; 26+ messages in thread
From: Ulf Magnusson @ 2016-10-01 2:47 UTC (permalink / raw)
To: openembedded-core
This sets a good example and avoids unnecessarily contributing to
perceived complexity and cargo culting.
Motivating quote below:
< kergoth> the *original* intent was for the function/task to error via
whatever appropriate means, bb.fatal, whatever, and
funcfailed was what you'd catch if you were calling
exec_func/exec_task. that is, it's what those functions
raise, not what metadata functions should be raising
< kergoth> it didn't end up being used that way
< kergoth> but there's really never a reason to raise it yourself
FuncFailed.__init__ takes a 'name' argument rather than a 'msg'
argument, which also shows that the original purpose got lost.
Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
---
meta/classes/utility-tasks.bbclass | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meta/classes/utility-tasks.bbclass b/meta/classes/utility-tasks.bbclass
index 7bc584a..7ba56e2 100644
--- a/meta/classes/utility-tasks.bbclass
+++ b/meta/classes/utility-tasks.bbclass
@@ -47,7 +47,7 @@ python do_checkuri() {
fetcher = bb.fetch2.Fetch(src_uri, d)
fetcher.checkstatus()
except bb.fetch2.BBFetchException as e:
- raise bb.build.FuncFailed(e)
+ bb.fatal(str(e))
}
addtask checkuriall after do_checkuri
--
2.7.4
^ permalink raw reply related [flat|nested] 26+ messages in thread* [PATCH 21/22] testimage.bbclass: Use bb.fatal() instead of raising FuncFailed
2016-10-01 2:46 [PATCH 00/22] Use bb.fatal() instead of raising FuncFailed Ulf Magnusson
` (19 preceding siblings ...)
2016-10-01 2:47 ` [PATCH 20/22] utility-tasks.bbclass: " Ulf Magnusson
@ 2016-10-01 2:47 ` Ulf Magnusson
2016-10-01 2:47 ` [PATCH 22/22] cmake: " Ulf Magnusson
21 siblings, 0 replies; 26+ messages in thread
From: Ulf Magnusson @ 2016-10-01 2:47 UTC (permalink / raw)
To: openembedded-core
This sets a good example and avoids unnecessarily contributing to
perceived complexity and cargo culting.
Motivating quote below:
< kergoth> the *original* intent was for the function/task to error via
whatever appropriate means, bb.fatal, whatever, and
funcfailed was what you'd catch if you were calling
exec_func/exec_task. that is, it's what those functions
raise, not what metadata functions should be raising
< kergoth> it didn't end up being used that way
< kergoth> but there's really never a reason to raise it yourself
FuncFailed.__init__ takes a 'name' argument rather than a 'msg'
argument, which also shows that the original purpose got lost.
Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
---
meta/classes/testimage.bbclass | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meta/classes/testimage.bbclass b/meta/classes/testimage.bbclass
index a908f92..5ddbecb 100644
--- a/meta/classes/testimage.bbclass
+++ b/meta/classes/testimage.bbclass
@@ -164,7 +164,7 @@ def testimage_main(d):
msg += " (skipped=%d)" % skipped
bb.plain(msg)
else:
- raise bb.build.FuncFailed("%s - FAILED - check the task log and the ssh log" % pn )
+ bb.fatal("%s - FAILED - check the task log and the ssh log" % pn)
finally:
signal.signal(signal.SIGTERM, tc.origsigtermhandler)
target.stop()
--
2.7.4
^ permalink raw reply related [flat|nested] 26+ messages in thread* [PATCH 22/22] cmake: Use bb.fatal() instead of raising FuncFailed
2016-10-01 2:46 [PATCH 00/22] Use bb.fatal() instead of raising FuncFailed Ulf Magnusson
` (20 preceding siblings ...)
2016-10-01 2:47 ` [PATCH 21/22] testimage.bbclass: " Ulf Magnusson
@ 2016-10-01 2:47 ` Ulf Magnusson
2016-10-05 20:26 ` Ulf Magnusson
21 siblings, 1 reply; 26+ messages in thread
From: Ulf Magnusson @ 2016-10-01 2:47 UTC (permalink / raw)
To: openembedded-core
This sets a good example and avoids unnecessarily contributing to
perceived complexity and cargo culting.
Motivating quote below:
< kergoth> the *original* intent was for the function/task to error via
whatever appropriate means, bb.fatal, whatever, and
funcfailed was what you'd catch if you were calling
exec_func/exec_task. that is, it's what those functions
raise, not what metadata functions should be raising
< kergoth> it didn't end up being used that way
< kergoth> but there's really never a reason to raise it yourself
FuncFailed.__init__ takes a 'name' argument rather than a 'msg'
argument, which also shows that the original purpose got lost.
Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
---
meta/recipes-devtools/cmake/cmake_3.6.1.bb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meta/recipes-devtools/cmake/cmake_3.6.1.bb b/meta/recipes-devtools/cmake/cmake_3.6.1.bb
index 67ba9c4..850d6de 100644
--- a/meta/recipes-devtools/cmake/cmake_3.6.1.bb
+++ b/meta/recipes-devtools/cmake/cmake_3.6.1.bb
@@ -14,7 +14,7 @@ python () {
docdir=d.getVar("docdir", True)
if not docdir.startswith(prefix):
- raise bb.build.FuncFailed('docdir must contain prefix as its prefix')
+ bb.fatal('docdir must contain prefix as its prefix')
docdir_stripped = docdir[len(prefix):]
if len(docdir_stripped) > 0 and docdir_stripped[0] == '/':
--
2.7.4
^ permalink raw reply related [flat|nested] 26+ messages in thread* Re: [PATCH 22/22] cmake: Use bb.fatal() instead of raising FuncFailed
2016-10-01 2:47 ` [PATCH 22/22] cmake: " Ulf Magnusson
@ 2016-10-05 20:26 ` Ulf Magnusson
2016-10-05 22:15 ` Richard Purdie
0 siblings, 1 reply; 26+ messages in thread
From: Ulf Magnusson @ 2016-10-05 20:26 UTC (permalink / raw)
To: OE-core
On Sat, Oct 1, 2016 at 4:47 AM, Ulf Magnusson <ulfalizer@gmail.com> wrote:
> This sets a good example and avoids unnecessarily contributing to
> perceived complexity and cargo culting.
>
> Motivating quote below:
>
> < kergoth> the *original* intent was for the function/task to error via
> whatever appropriate means, bb.fatal, whatever, and
> funcfailed was what you'd catch if you were calling
> exec_func/exec_task. that is, it's what those functions
> raise, not what metadata functions should be raising
> < kergoth> it didn't end up being used that way
> < kergoth> but there's really never a reason to raise it yourself
>
> FuncFailed.__init__ takes a 'name' argument rather than a 'msg'
> argument, which also shows that the original purpose got lost.
>
> Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
> ---
> meta/recipes-devtools/cmake/cmake_3.6.1.bb | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/meta/recipes-devtools/cmake/cmake_3.6.1.bb b/meta/recipes-devtools/cmake/cmake_3.6.1.bb
> index 67ba9c4..850d6de 100644
> --- a/meta/recipes-devtools/cmake/cmake_3.6.1.bb
> +++ b/meta/recipes-devtools/cmake/cmake_3.6.1.bb
> @@ -14,7 +14,7 @@ python () {
> docdir=d.getVar("docdir", True)
>
> if not docdir.startswith(prefix):
> - raise bb.build.FuncFailed('docdir must contain prefix as its prefix')
> + bb.fatal('docdir must contain prefix as its prefix')
>
> docdir_stripped = docdir[len(prefix):]
> if len(docdir_stripped) > 0 and docdir_stripped[0] == '/':
> --
> 2.7.4
>
Thanks for merging these!
There's now some documentation that mentions FuncFailed as well:
https://www.yoctoproject.org/docs/2.2/bitbake-user-manual/bitbake-user-manual.html#bitbake-style-python-functions-versus-python-functions
Cheers,
Ulf
^ permalink raw reply [flat|nested] 26+ messages in thread* Re: [PATCH 22/22] cmake: Use bb.fatal() instead of raising FuncFailed
2016-10-05 20:26 ` Ulf Magnusson
@ 2016-10-05 22:15 ` Richard Purdie
2016-10-05 23:02 ` Ulf Magnusson
0 siblings, 1 reply; 26+ messages in thread
From: Richard Purdie @ 2016-10-05 22:15 UTC (permalink / raw)
To: Ulf Magnusson, OE-core
On Wed, 2016-10-05 at 22:26 +0200, Ulf Magnusson wrote:
> On Sat, Oct 1, 2016 at 4:47 AM, Ulf Magnusson <ulfalizer@gmail.com>
> wrote:
> >
> > This sets a good example and avoids unnecessarily contributing to
> > perceived complexity and cargo culting.
> >
> > Motivating quote below:
> >
> > < kergoth> the *original* intent was for the function/task to error
> > via
> > whatever appropriate means, bb.fatal, whatever, and
> > funcfailed was what you'd catch if you were calling
> > exec_func/exec_task. that is, it's what those functions
> > raise, not what metadata functions should be raising
> > < kergoth> it didn't end up being used that way
> > < kergoth> but there's really never a reason to raise it yourself
> >
> > FuncFailed.__init__ takes a 'name' argument rather than a 'msg'
> > argument, which also shows that the original purpose got lost.
> >
> > Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
> > ---
> > meta/recipes-devtools/cmake/cmake_3.6.1.bb | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/meta/recipes-devtools/cmake/cmake_3.6.1.bb
> > b/meta/recipes-devtools/cmake/cmake_3.6.1.bb
> > index 67ba9c4..850d6de 100644
> > --- a/meta/recipes-devtools/cmake/cmake_3.6.1.bb
> > +++ b/meta/recipes-devtools/cmake/cmake_3.6.1.bb
> > @@ -14,7 +14,7 @@ python () {
> > docdir=d.getVar("docdir", True)
> >
> > if not docdir.startswith(prefix):
> > - raise bb.build.FuncFailed('docdir must contain prefix as
> > its prefix')
> > + bb.fatal('docdir must contain prefix as its prefix')
> >
> > docdir_stripped = docdir[len(prefix):]
> > if len(docdir_stripped) > 0 and docdir_stripped[0] == '/':
> > --
> > 2.7.4
> >
> Thanks for merging these!
>
> There's now some documentation that mentions FuncFailed as well:
> https://www.yoctoproject.org/docs/2.2/bitbake-user-manual/bitbake-use
> r-manual.html#bitbake-style-python-functions-versus-python-functions
It did break one of the tests in oe-selftest but we've fixed that...
Cheers,
Richard
^ permalink raw reply [flat|nested] 26+ messages in thread* Re: [PATCH 22/22] cmake: Use bb.fatal() instead of raising FuncFailed
2016-10-05 22:15 ` Richard Purdie
@ 2016-10-05 23:02 ` Ulf Magnusson
0 siblings, 0 replies; 26+ messages in thread
From: Ulf Magnusson @ 2016-10-05 23:02 UTC (permalink / raw)
To: Richard Purdie; +Cc: OE-core
On Thu, Oct 6, 2016 at 12:15 AM, Richard Purdie
<richard.purdie@linuxfoundation.org> wrote:
> On Wed, 2016-10-05 at 22:26 +0200, Ulf Magnusson wrote:
>> On Sat, Oct 1, 2016 at 4:47 AM, Ulf Magnusson <ulfalizer@gmail.com>
>> wrote:
>> >
>> > This sets a good example and avoids unnecessarily contributing to
>> > perceived complexity and cargo culting.
>> >
>> > Motivating quote below:
>> >
>> > < kergoth> the *original* intent was for the function/task to error
>> > via
>> > whatever appropriate means, bb.fatal, whatever, and
>> > funcfailed was what you'd catch if you were calling
>> > exec_func/exec_task. that is, it's what those functions
>> > raise, not what metadata functions should be raising
>> > < kergoth> it didn't end up being used that way
>> > < kergoth> but there's really never a reason to raise it yourself
>> >
>> > FuncFailed.__init__ takes a 'name' argument rather than a 'msg'
>> > argument, which also shows that the original purpose got lost.
>> >
>> > Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
>> > ---
>> > meta/recipes-devtools/cmake/cmake_3.6.1.bb | 2 +-
>> > 1 file changed, 1 insertion(+), 1 deletion(-)
>> >
>> > diff --git a/meta/recipes-devtools/cmake/cmake_3.6.1.bb
>> > b/meta/recipes-devtools/cmake/cmake_3.6.1.bb
>> > index 67ba9c4..850d6de 100644
>> > --- a/meta/recipes-devtools/cmake/cmake_3.6.1.bb
>> > +++ b/meta/recipes-devtools/cmake/cmake_3.6.1.bb
>> > @@ -14,7 +14,7 @@ python () {
>> > docdir=d.getVar("docdir", True)
>> >
>> > if not docdir.startswith(prefix):
>> > - raise bb.build.FuncFailed('docdir must contain prefix as
>> > its prefix')
>> > + bb.fatal('docdir must contain prefix as its prefix')
>> >
>> > docdir_stripped = docdir[len(prefix):]
>> > if len(docdir_stripped) > 0 and docdir_stripped[0] == '/':
>> > --
>> > 2.7.4
>> >
>> Thanks for merging these!
>>
>> There's now some documentation that mentions FuncFailed as well:
>> https://www.yoctoproject.org/docs/2.2/bitbake-user-manual/bitbake-use
>> r-manual.html#bitbake-style-python-functions-versus-python-functions
>
> It did break one of the tests in oe-selftest but we've fixed that...
>
> Cheers,
>
> Richard
Sorry about that. I wasn't even aware of oe-selftest until now.
Yeah... the format for fetch failures changed slightly.
Cheers,
Ulf
^ permalink raw reply [flat|nested] 26+ messages in thread