mirror of
https://gitlab.com/buildroot.org/buildroot.git
synced 2026-08-01 21:23:51 -09:00
support/scripts/pkg-stats: run main function only if called as script
The __name__ == '__main__' guard allows importing pkg-stats as a
module using importlib, circumventing the normal module filename
requirements. This in turn makes it possible to test/debug individual
functions.
Signed-off-by: Fiona Klute <fiona.klute@gmx.de>
Signed-off-by: Arnout Vandecappelle <arnout@rnout.be>
(cherry picked from commit 8cde69e101)
Signed-off-by: Thomas Perale <thomas.perale@mind.be>
This commit is contained in:
committed by
Thomas Perale
parent
0b36bd22e8
commit
3d586c429b
@@ -1334,7 +1334,7 @@ def is_newer_version_available(pkg):
|
||||
)
|
||||
|
||||
|
||||
def __main__():
|
||||
def main():
|
||||
global cvecheck
|
||||
|
||||
args = parse_args()
|
||||
@@ -1403,4 +1403,5 @@ def __main__():
|
||||
dump_json(packages, defconfigs, stats, date, commit, args.json)
|
||||
|
||||
|
||||
__main__()
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
Reference in New Issue
Block a user