All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] scripts/autobuild-run: add --branches option
@ 2019-01-15 14:11 Arnout Vandecappelle
  2019-01-16  8:55 ` Thomas Petazzoni
  0 siblings, 1 reply; 3+ messages in thread
From: Arnout Vandecappelle @ 2019-01-15 14:11 UTC (permalink / raw)
  To: buildroot

From: Arnout Vandecappelle <arnout.vandecappelle@essensium.com>

The autobuild-run script will retrieve the list of branches to test
from autobuild.buildroot.org. However, it the autobuild script is used
to test some local configuration, this is probably not appropriate. The
new --branches option allows to override the URL of the branches CSV
file. A file:/// URL can be used for a local file.

Signed-off-by: Arnout Vandecappelle <arnout.vandecappelle@essensium.com>
---
 scripts/autobuild-run | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/scripts/autobuild-run b/scripts/autobuild-run
index 3d2e99a..77272f5 100755
--- a/scripts/autobuild-run
+++ b/scripts/autobuild-run
@@ -69,6 +69,7 @@ defaults = {
     '--http-url': 'http://autobuild.buildroot.org/submit/',
     '--toolchains-csv': 'support/config-fragments/autobuild/toolchain-configs.csv',
     '--repo': 'https://github.com/buildroot/buildroot.git',
+    '--branches': 'http://autobuild.buildroot.org/branches',
 }
 
 doc = """autobuild-run - run Buildroot autobuilder
@@ -106,6 +107,8 @@ Options:
   --toolchains-csv CSVFILE       Toolchain configuration file
   -r, --repo URL                 URL of Buildroot repository to clone
                                  Defaults to %(--repo)s
+  --branches URL                 URL of CSV file with branches to test
+                                 Defaults to %(--branches)s
 
 Format of the configuration file:
 
@@ -185,7 +188,7 @@ def check_version():
         print("ERROR: script version too old, please upgrade.")
         sys.exit(1)
 
-def get_branch():
+def get_branch(url):
     """Returns the branch that should be built. It fetches a CSV file from
     autobuild.buildroot.org that provides the list of branches to test
     (first field) and their weight (second field). We build a list of
@@ -194,7 +197,7 @@ def get_branch():
     list. This way, branches with a higher weight are more likely to
     be selected.
     """
-    with urlopen_closing('http://autobuild.buildroot.org/branches') as r:
+    with urlopen_closing(url) as r:
         csv_branches = r.readlines()
     branches = []
     for branch in csv.reader(csv_branches):
@@ -314,7 +317,7 @@ def prepare_build(**kwargs):
                   os.path.relpath(f, dldir))
         os.remove(f)
 
-    branch = get_branch()
+    branch = get_branch(kwargs['branches'])
     log_write(log, "INFO: testing branch '%s'" % branch)
 
     # Clone Buildroot. This only happens if the source directory
@@ -764,6 +767,7 @@ def main():
                 nice = (args['--nice'] or 0),
                 toolchains_csv = args['--toolchains-csv'],
                 repo = args['--repo'],
+                branches = args['--branches'],
                 upload = upload,
                 buildpid = buildpid,
                 debug = args['--debug']
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-01-16 11:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-15 14:11 [Buildroot] [PATCH] scripts/autobuild-run: add --branches option Arnout Vandecappelle
2019-01-16  8:55 ` Thomas Petazzoni
2019-01-16 11:58   ` Arnout Vandecappelle

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.