diff mbox series

[3/4] bitbake-setup: Add the conditional script stanza

Message ID 20260326173951.519326-4-rob.woolley@windriver.com
State New
Headers show
Series [1/4] bin: Move version information to common file | expand

Commit Message

Rob Woolley March 26, 2026, 5:39 p.m. UTC
This ensures that the main function is only executed if
the module is executed in the top-level environment.

Signed-off-by: Rob Woolley <rob.woolley@windriver.com>
---
 bin/bitbake-setup | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/bin/bitbake-setup b/bin/bitbake-setup
index b05894e01..d7e2e187c 100755
--- a/bin/bitbake-setup
+++ b/bin/bitbake-setup
@@ -1192,4 +1192,5 @@  def main():
         from argparse import Namespace
         parser.print_help()
 
-main()
+if __name__ == '__main__':
+    main()