public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Paweł Hajdan" <phajdan.jr@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/arch-tools:master commit in: /
Date: Wed, 23 Nov 2011 08:59:04 +0000 (UTC)	[thread overview]
Message-ID: <5a195bce432416b7486ec481d7dbb241c80fc412.phajdan.jr@gentoo> (raw)

commit:     5a195bce432416b7486ec481d7dbb241c80fc412
Author:     Pawel Hajdan, Jr <phajdan.jr <AT> gentoo <DOT> org>
AuthorDate: Wed Nov 23 08:57:03 2011 +0000
Commit:     Paweł Hajdan <phajdan.jr <AT> gentoo <DOT> org>
CommitDate: Wed Nov 23 08:57:03 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/arch-tools.git;a=commit;h=5a195bce

Automatically file stabilization bugs.

---
 stabilization-candidates.py |   43 ++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 38 insertions(+), 5 deletions(-)

diff --git a/stabilization-candidates.py b/stabilization-candidates.py
index 5d0c3f8..696ad9c 100755
--- a/stabilization-candidates.py
+++ b/stabilization-candidates.py
@@ -5,8 +5,10 @@
 import datetime
 import optparse
 import os.path
+import random
 import re
 import subprocess
+import urllib
 
 import bugz.bugzilla
 from portage.package.ebuild.getmaskingstatus import getmaskingstatus
@@ -21,6 +23,7 @@ if __name__ == "__main__":
 	parser = optparse.OptionParser()
 	parser.add_option("--arch", dest="arch", action="append", help="Gentoo arch to use, e.g. x86, amd64, ... Can be passed multiple times.")
 	parser.add_option("--days", dest="days", type=int, default=30, help="Number of days in the tree after stabilization is possible.")
+	parser.add_option("-l", "--limit", dest="limit", type="int", default=-1, help="Limit of filed bugs. Default is no limit.")
 	parser.add_option("--repo", dest="repo", help="Path to portage CVS repository")
 	parser.add_option("--category", dest="category", help="Portage category filter (default is all categories)")
 
@@ -37,6 +40,7 @@ if __name__ == "__main__":
 	bugzilla = MyBugz(url)
 	bugzilla.auth()
 	
+	final_candidates = []
 	now = datetime.datetime.now()
 	for cp in portage.portdb.cp_all():
 		if options.category and not cp.startswith(options.category + "/"):
@@ -44,6 +48,7 @@ if __name__ == "__main__":
 		best_stable = portage.versions.best(portage.portdb.match(cp))
 		if not best_stable:
 			continue
+		print 'Working on %s...' % cp
 		candidates = []
 		for cpv in portage.portdb.cp_list(cp):
 			# Only consider higher versions than best stable.
@@ -58,6 +63,12 @@ if __name__ == "__main__":
 					break
 			if is_unstable:
 				continue
+			
+			# Eliminate 'live' packages. Obviously have some false positives,
+			# but it'd be much worse to miss something. There are variations
+			# like -r9999 or .9999 in the tree.
+			if '99' in cpv:
+				continue
 
 			# Eliminate hard masked packages among others.
 			if getmaskingstatus(cpv) not in [[u'~%s keyword' % arch] for arch in options.arch]:
@@ -77,7 +88,6 @@ if __name__ == "__main__":
 		if not candidates:
 			continue
 		candidates.sort(key=portage.versions.cpv_sort_key())
-		print '\t\tWorking on %s. Candidates: %s' % (cp, ', '.join(candidates))
 		candidates.reverse()
 		best_candidate = None
 		cvs_path = os.path.join(options.repo, cp)
@@ -115,8 +125,31 @@ if __name__ == "__main__":
 				continue
 
 			metadata = MetaDataXML(os.path.join(cvs_path, 'metadata.xml'), '/usr/portage/metadata/herds.xml')
+			maintainer_split = metadata.format_maintainer_string().split(' ', 1)
+			maintainer = maintainer_split[0]
+			if len(maintainer_split) > 1:
+				other_maintainers = maintainer_split[1].split(',')
+			else:
+				other_maintainers = []
+			url = 'http://packages.gentoo.org/package/%s?arches=linux' % urllib.quote(cp)
+			final_candidates.append((best_candidate, url, maintainer, other_maintainers))
 
-			# Spam protection (strip @ and domain name).
-			maintainer_string = re.sub('@[^\s]*', '', metadata.format_maintainer_string())
-
-			print (cp, best_stable, best_candidate, maintainer_string)
+	if options.limit != -1:
+		final_candidates = random.sample(final_candidates, min(options.limit, len(final_candidates)))
+	for x in final_candidates:
+		best_candidate, url, maintainer, other_maintainers = x
+		description = ('Is it OK to stabilize =%s ?\n\n' % best_candidate +
+		               'If so, please CC arches and add STABLEREQ keyword.\n\n' +
+			       'Stabilization of this package has been repoman-checked on the following arches: %s' % ', '.join(options.arch))
+		bug_id = bugzilla.post('Gentoo Linux',
+		                       'Keywording and Stabilization',
+				       'Please stabilize =%s' % best_candidate,
+				       description,
+				       url=url,
+				       assigned_to=maintainer,
+				       cc=other_maintainers,
+				       severity='enhancement')
+		if bug_id == 0:
+			print 'Submitting bug for %s failed. :-(' % best_candidate
+		else:
+			print 'Submitted bug #%d for %s. ;-)' % (bug_id, best_candidate)



             reply	other threads:[~2011-11-23  8:59 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-23  8:59 Paweł Hajdan [this message]
  -- strict thread matches above, loose matches on Subject: below --
2017-07-10 20:29 [gentoo-commits] proj/arch-tools:master commit in: / Paweł Hajdan
2017-07-09 14:42 Paweł Hajdan
2015-01-05 14:41 Paweł Hajdan
2015-01-05 14:41 Paweł Hajdan
2015-01-05 14:41 Paweł Hajdan
2014-06-14  9:47 Paweł Hajdan
2014-04-07 12:40 Samuli Suominen
2014-02-12  7:06 Paweł Hajdan
2013-06-22 15:05 Paweł Hajdan
2013-06-22 14:57 Paweł Hajdan
2013-05-19 23:35 Paweł Hajdan
2013-03-11 21:56 Paweł Hajdan
2013-02-28  4:50 Paweł Hajdan
2013-02-28  4:50 Paweł Hajdan
2012-10-16 16:54 Paweł Hajdan
2012-10-16 16:54 Paweł Hajdan
2012-10-08 16:03 Paweł Hajdan
2012-10-08 16:03 Paweł Hajdan
2012-10-08 16:03 Paweł Hajdan
2012-10-08 16:03 Paweł Hajdan
2012-10-08 16:03 Paweł Hajdan
2012-10-08 16:03 Paweł Hajdan
2012-10-08 16:03 Paweł Hajdan
2012-10-08 16:02 [gentoo-commits] proj/arch-tools:new-pybugz " Paweł Hajdan
2012-10-08 16:03 ` [gentoo-commits] proj/arch-tools:master " Paweł Hajdan
2012-08-01 11:08 [gentoo-commits] proj/arch-tools:new-pybugz " Paweł Hajdan
2012-10-08 16:03 ` [gentoo-commits] proj/arch-tools:master " Paweł Hajdan
2012-08-01  7:28 [gentoo-commits] proj/arch-tools:new-pybugz " Paweł Hajdan
2012-10-08 16:03 ` [gentoo-commits] proj/arch-tools:master " Paweł Hajdan
2012-06-04  9:18 [gentoo-commits] proj/arch-tools:new-pybugz " Paweł Hajdan
2012-10-08 16:03 ` [gentoo-commits] proj/arch-tools:master " Paweł Hajdan
2012-03-27 15:26 Paweł Hajdan
2012-03-09 11:49 Paweł Hajdan
2012-03-09 11:49 Paweł Hajdan
2012-02-02 16:48 Paweł Hajdan
2012-01-27 14:55 Paweł Hajdan
2012-01-21 17:05 Paweł Hajdan
2011-12-14  7:23 Paweł Hajdan
2011-12-06 11:14 Paweł Hajdan
2011-12-01 18:56 Paweł Hajdan
2011-12-01 18:47 Paweł Hajdan
2011-12-01 18:47 Paweł Hajdan
2011-11-30 17:38 Paweł Hajdan
2011-11-23  8:59 Paweł Hajdan
2011-11-21  8:34 Paweł Hajdan
2011-11-03 11:00 Paweł Hajdan
2011-10-22  8:18 Paweł Hajdan
2011-10-21 15:15 Paweł Hajdan
2011-10-18 14:05 Paweł Hajdan
2011-10-16  3:51 Paweł Hajdan
2011-10-13 21:59 Paweł Hajdan
2011-10-04 21:46 Paweł Hajdan
2011-09-19  3:09 Paweł Hajdan
2011-08-07  3:26 Paweł Hajdan
2011-06-05 16:16 Paweł Hajdan
2011-06-02 15:41 Paweł Hajdan
2011-06-02 15:38 Paweł Hajdan
2011-05-25 19:51 Paweł Hajdan
2011-05-25 10:32 Paweł Hajdan
2011-05-22 15:31 Paweł Hajdan
2011-05-22 15:16 Paweł Hajdan
2011-05-22 13:36 Paweł Hajdan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5a195bce432416b7486ec481d7dbb241c80fc412.phajdan.jr@gentoo \
    --to=phajdan.jr@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox