]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
prscript: add --norebase option
authorEric Leblond <eric@regit.org>
Thu, 19 Dec 2013 14:18:46 +0000 (15:18 +0100)
committerVictor Julien <victor@inliniac.net>
Fri, 10 Jan 2014 14:32:07 +0000 (15:32 +0100)
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.

qa/prscript.py

index 6e376a5ff9f6bf9a2dbbc7c0e8d5f137a21d7b3c..2a28a65ffa4c89123cb58b5a704d476c6deab042 100755 (executable)
@@ -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)