]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
go-vendor: Minor style tweaks
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 6 Nov 2023 16:42:51 +0000 (16:42 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 8 Nov 2023 10:56:33 +0000 (10:56 +0000)
Drop a len() usage that isn't needed, drop a comment that isn't needed
and use bb.fatal() to end the task with an error.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/go-vendor.bbclass

index 5b017b0b9dac07fa951e098fea8fed11227e45a0..2426bddfba45da6073da8c2fa16e304c81dce801 100644 (file)
@@ -41,9 +41,6 @@ def go_src_uri(repo, version, path=None, subdir=None, \
     return src_uri
 
 python do_vendor_unlink() {
-
-    # We unlink
-
     go_import = d.getVar('GO_IMPORT')
     source_dir = d.getVar('S')
     linkname = os.path.join(source_dir, *['src', go_import, 'vendor'])
@@ -58,9 +55,8 @@ python do_go_vendor() {
 
     src_uri = (d.getVar('SRC_URI') or "").split()
 
-    if len(src_uri) == 0:
-        bb.error("SRC_URI is empty")
-        return
+    if not src_uri:
+        bb.fatal("SRC_URI is empty")
 
     default_destsuffix = "git/src/import/vendor.fetch"
     fetcher = bb.fetch2.Fetch(src_uri, d)