From owner-svn-src-projects@FreeBSD.ORG Sun Dec 11 21:30:18 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 57C1E1065676; Sun, 11 Dec 2011 21:30:18 +0000 (UTC) (envelope-from linimon@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2ECD18FC08; Sun, 11 Dec 2011 21:30:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pBBLUISf069993; Sun, 11 Dec 2011 21:30:18 GMT (envelope-from linimon@svn.freebsd.org) Received: (from linimon@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pBBLUIAf069991; Sun, 11 Dec 2011 21:30:18 GMT (envelope-from linimon@svn.freebsd.org) Message-Id: <201112112130.pBBLUIAf069991@svn.freebsd.org> From: Mark Linimon Date: Sun, 11 Dec 2011 21:30:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r228428 - projects/portbuild/qmanager X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Dec 2011 21:30:18 -0000 Author: linimon (doc,ports committer) Date: Sun Dec 11 21:30:17 2011 New Revision: 228428 URL: http://svn.freebsd.org/changeset/base/228428 Log: Add a way to defeat the runaway-build check by passing a parameter -unlimited-errors. (To do this, add code for parameter checking in the first place.) This parameter is primarily useful for -restart or -trybroken runs where you are expecting a lot of errors. Modified: projects/portbuild/qmanager/packagebuild Modified: projects/portbuild/qmanager/packagebuild ============================================================================== --- projects/portbuild/qmanager/packagebuild Sun Dec 11 21:26:49 2011 (r228427) +++ projects/portbuild/qmanager/packagebuild Sun Dec 11 21:30:17 2011 (r228428) @@ -65,14 +65,22 @@ QMANAGER_RUNAWAY_PERCENTAGE = float( \ QMANAGER_RUNAWAY_THRESHOLD = int( \ config.get( 'QMANAGER_RUNAWAY_THRESHOLD' ) ) +# debug controls DEBUG_PACKAGEBUILD = False DEBUG_RETCODE = False +# argument handling +ARG_UNLIMITED_ERRORS = "unlimited-errors" + +# global variables + categories = {} ports = {} pkg_sufx = None +unlimited_errors = False + # When a build fails we requeue it with a lower priority such that it # will never preempt a phase 1 build but will build when spare # capacity is available. @@ -538,13 +546,24 @@ def main(arch, branch, buildid, args): print "error: pkg_sufx not defined in portbuild.conf" sys.exit(1) - print "[MASTER] parseindex..." + print "[MASTER] Parsing INDEX..." index = Index(indexfile) index.parse() print "[MASTER] length = %s" % len(ports) + print "[MASTER] Parsing arguments..." + targets = [] + for arg in args: + if arg.find( "-" ) == 0: + if ( arg[ 1 : ] == ARG_UNLIMITED_ERRORS): + unlimited_errors = True + else: + print "[MASTER] arg %s not recognized, ignoring." % arg[ 1 : ] + else: + targets = targets.append( arg ) + print "[MASTER] Finding targets..." - targets = gettargets(args) + targets = gettargets(targets) print "[MASTER] Calculating depth..." depthindex(targets) @@ -593,13 +612,13 @@ def main(arch, branch, buildid, args): job.failure() continue else: - # XXX MCL 20110421 completed_jobs = completed_jobs + 1 failed_jobs = failed_jobs + 1 if DEBUG_PACKAGEBUILD: print "[MASTER] jobs: %d failed jobs out of %d:" % \ ( failed_jobs, completed_jobs ) - if completed_jobs > QMANAGER_RUNAWAY_THRESHOLD and \ + if not unlimited_errors and \ + completed_jobs > QMANAGER_RUNAWAY_THRESHOLD and \ float( failed_jobs ) / completed_jobs > QMANAGER_RUNAWAY_PERCENTAGE: print "[MASTER] ERROR: runaway build detected: %d failed jobs out of %d:" % \ ( failed_jobs, completed_jobs )