osmith has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-dev/+/40351?usp=email )

Change subject: gen_makefile: use args.jobs directly
......................................................................

gen_makefile: use args.jobs directly

Make the code easier to follow by not passing unmodified or slightly
modified argparse parameters as function arguments through multiple
functions. Access them from "args" directly. The following patches make
similar adjustments for other parameters.

Change-Id: I49d340fdc47e66a9419dbc27f40774c1307f9526
---
M gen_makefile.py
1 file changed, 5 insertions(+), 6 deletions(-)

Approvals:
  Jenkins Builder: Verified
  pespin: Looks good to me, but someone else must approve
  fixeria: Looks good to me, approved




diff --git a/gen_makefile.py b/gen_makefile.py
index 550c722..db82c8f 100755
--- a/gen_makefile.py
+++ b/gen_makefile.py
@@ -308,7 +308,7 @@
   else:
     assert False, f"unknown buildsystem: {buildsystem}"

-def gen_makefile_build(proj, distclean_cond, build_proj, docker_cmd, jobs,
+def gen_makefile_build(proj, distclean_cond, build_proj, docker_cmd,
                        check, src_proj, update_src_copy_cmd):
   buildsystem = projects_buildsystems.get(proj, "autotools")

@@ -318,7 +318,7 @@
   if {distclean_cond}; then $(MAKE) {proj}-distclean .make.{proj}.configure; fi
   @echo "\\n\\n\\n===== $@\\n"
   {update_src_copy_cmd}
-  {docker_cmd}$(MAKE) -C {build_proj} -j {jobs} {check}
+  {docker_cmd}$(MAKE) -C {build_proj} -j {args.jobs} {check}
   sync
   touch $@
     '''
@@ -330,7 +330,7 @@
     return f'''
 .make.{proj}.build: .make.{proj}.configure $({proj}_files)
   @echo "\\n\\n\\n===== $@\\n"
-  {docker_cmd}meson compile -C {build_proj} -j {jobs}
+  {docker_cmd}meson compile -C {build_proj} -j {args.jobs}
   {test_line}
   sync
   touch $@
@@ -440,7 +440,7 @@
     return src_proj
   return os.path.join(make_dir, "src_copy", proj)

-def gen_make(proj, deps, configure_opts, jobs, make_dir, src_dir, build_dir, 
url, push_url, sudo_make_install, no_ldconfig, ldconfig_without_sudo, 
make_check):
+def gen_make(proj, deps, configure_opts, make_dir, src_dir, build_dir, url, 
push_url, sudo_make_install, no_ldconfig, ldconfig_without_sudo, make_check):
   src_proj = os.path.join(src_dir, proj)
   src_proj_copy = gen_src_proj_copy(src_proj, make_dir, proj)

@@ -512,7 +512,6 @@
                     distclean_cond,
                     build_proj,
                     docker_cmd,
-                    jobs,
                     check,
                     src_proj_copy,
                     update_src_copy_cmd)}
@@ -690,7 +689,7 @@
   all_config_opts = []
   all_config_opts.extend(configure_opts.get('ALL') or [])
   all_config_opts.extend(configure_opts.get(proj) or [])
-  content += gen_make(proj, deps, all_config_opts, args.jobs,
+  content += gen_make(proj, deps, all_config_opts,
                      make_dir, src_dir, build_dir, args.url, args.push_url,
                      args.sudo_make_install, args.no_ldconfig,
                      args.ldconfig_without_sudo, args.make_check)

--
To view, visit https://gerrit.osmocom.org/c/osmo-dev/+/40351?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings?usp=email

Gerrit-MessageType: merged
Gerrit-Project: osmo-dev
Gerrit-Branch: master
Gerrit-Change-Id: I49d340fdc47e66a9419dbc27f40774c1307f9526
Gerrit-Change-Number: 40351
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osm...@sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanits...@sysmocom.de>
Gerrit-Reviewer: osmith <osm...@sysmocom.de>
Gerrit-Reviewer: pespin <pes...@sysmocom.de>

Reply via email to