From: Eric Leblond Date: Thu, 19 Dec 2013 14:18:46 +0000 (+0100) Subject: prscript: add --norebase option X-Git-Tag: suricata-2.0rc1~229 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=55108167e51ab4effb4985a63fee570c215ff9e8;p=thirdparty%2Fsuricata.git prscript: add --norebase option If --norebase option is provided, the prscript will start a build that can be used to check if an out-of-sync branch pass the test. --- diff --git a/qa/prscript.py b/qa/prscript.py index 6e376a5ff9..2a28a65ffa 100755 --- a/qa/prscript.py +++ b/qa/prscript.py @@ -35,6 +35,7 @@ parser.add_argument('-u', '--username', dest='username', help='github and buildb parser.add_argument('-p', '--password', dest='password', help='buildbot password') parser.add_argument('-c', '--check', action='store_const', const=True, help='only check last build', default=False) parser.add_argument('-v', '--verbose', action='store_const', const=True, help='verbose output', default=False) +parser.add_argument('--norebase', action='store_const', const=True, help='do not test if branch is in sync with master', default=False) parser.add_argument('-r', '--repository', dest='repository', default='suricata', help='name of suricata repository on github') parser.add_argument('branch', metavar='branch', help='github branch to build') args = parser.parse_args() @@ -132,10 +133,13 @@ def WaitForBuildResult(builder, buildid, extension=""): print "Build failure: " + BUILDERS_URI + username + extension + '/builds/' + str(buildid) return res -# check that github branch and inliniac master branch are sync + # check that github branch and inliniac master branch are sync if TestRepoSync(args.branch) == -1: - print "Branch " + args.branch + " is not in sync with inliniac's master branch. Rebase needed." - sys.exit(-1) + if args.norebase: + print "Branch " + args.branch + " is not in sync with inliniac's master branch. Continuing due to --norebase option." + else: + print "Branch " + args.branch + " is not in sync with inliniac's master branch. Rebase needed." + sys.exit(-1) # submit buildbot form to build current branch on the devel builder if not args.check: @@ -183,9 +187,10 @@ if buildidpcap != -1: res += WaitForBuildResult(username, buildidpcap, extension="-pcap") if res == 0: - print "You can copy/paste following lines into github PR" - print "- PR build: " + BUILDERS_URI + username + "/builds/" + str(buildid) - print "- PR pcaps: " + BUILDERS_URI + username + "-pcap/builds/" + str(buildidpcap) + if not args.norebase: + print "You can copy/paste following lines into github PR" + print "- PR build: " + BUILDERS_URI + username + "/builds/" + str(buildid) + print "- PR pcaps: " + BUILDERS_URI + username + "-pcap/builds/" + str(buildidpcap) sys.exit(0) else: sys.exit(-1)