public inbox for gentoo-portage-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-portage-dev] [PATCH] repoman: add --straight-to-stable (-S) option
@ 2015-03-24  9:10 Michał Górny
  2015-03-24 18:06 ` Zac Medico
  0 siblings, 1 reply; 4+ messages in thread
From: Michał Górny @ 2015-03-24  9:10 UTC (permalink / raw
  To: gentoo-portage-dev; +Cc: Michał Górny

Add an option to safely allow committing ebuilds straight to stable.
Before, this required either round trips with multiple commits or
--force option that ignored valid QA concerns and (surprisingly to many
developers) skipped some expensive QA checks.
---
 bin/repoman | 28 ++++++++++++++++------------
 1 file changed, 16 insertions(+), 12 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index 13c220d..03664bd 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -191,6 +191,9 @@ def ParseArgs(argv, qahelp):
 	parser.add_argument('-f', '--force', dest='force', default=False, action='store_true',
 		help='Commit with QA violations')
 
+	parser.add_argument('-S', '--straight-to-stable', dest='straight_to_stable', default=False,
+		action='store_true', help='Allow committing straight to stable')
+
 	parser.add_argument('--vcs', dest='vcs',
 		help='Force using specific VCS instead of autodetection')
 
@@ -1908,18 +1911,19 @@ for x in effective_scanlist:
 				(relative_path, len(myaux['DESCRIPTION']), max_desc_len))
 
 		keywords = myaux["KEYWORDS"].split()
-		stable_keywords = []
-		for keyword in keywords:
-			if not keyword.startswith("~") and \
-				not keyword.startswith("-"):
-				stable_keywords.append(keyword)
-		if stable_keywords:
-			if ebuild_path in new_ebuilds and catdir != "virtual":
-				stable_keywords.sort()
-				stats["KEYWORDS.stable"] += 1
-				fails["KEYWORDS.stable"].append(
-					x + "/" + y + ".ebuild added with stable keywords: %s" % \
-						" ".join(stable_keywords))
+		if not options.straight_to_stable:
+		    stable_keywords = []
+		    for keyword in keywords:
+			    if not keyword.startswith("~") and \
+				    not keyword.startswith("-"):
+				    stable_keywords.append(keyword)
+		    if stable_keywords:
+			    if ebuild_path in new_ebuilds and catdir != "virtual":
+				    stable_keywords.sort()
+				    stats["KEYWORDS.stable"] += 1
+				    fails["KEYWORDS.stable"].append(
+					    x + "/" + y + ".ebuild added with stable keywords: %s" % \
+						    " ".join(stable_keywords))
 
 		ebuild_archs = set(kw.lstrip("~") for kw in keywords \
 			if not kw.startswith("-"))
-- 
2.3.3



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

* Re: [gentoo-portage-dev] [PATCH] repoman: add --straight-to-stable (-S) option
  2015-03-24  9:10 [gentoo-portage-dev] [PATCH] repoman: add --straight-to-stable (-S) option Michał Górny
@ 2015-03-24 18:06 ` Zac Medico
  2015-03-25  8:12   ` [gentoo-portage-dev] [PATCH v2] " Michał Górny
  0 siblings, 1 reply; 4+ messages in thread
From: Zac Medico @ 2015-03-24 18:06 UTC (permalink / raw
  To: gentoo-portage-dev

On 03/24/2015 02:10 AM, Michał Górny wrote:
> Add an option to safely allow committing ebuilds straight to stable.
> Before, this required either round trips with multiple commits or
> --force option that ignored valid QA concerns and (surprisingly to many
> developers) skipped some expensive QA checks.
> ---
>  bin/repoman | 28 ++++++++++++++++------------
>  1 file changed, 16 insertions(+), 12 deletions(-)
> 
> diff --git a/bin/repoman b/bin/repoman
> index 13c220d..03664bd 100755
> --- a/bin/repoman
> +++ b/bin/repoman
> @@ -191,6 +191,9 @@ def ParseArgs(argv, qahelp):
>  	parser.add_argument('-f', '--force', dest='force', default=False, action='store_true',
>  		help='Commit with QA violations')
>  
> +	parser.add_argument('-S', '--straight-to-stable', dest='straight_to_stable', default=False,
> +		action='store_true', help='Allow committing straight to stable')
> +
>  	parser.add_argument('--vcs', dest='vcs',
>  		help='Force using specific VCS instead of autodetection')
>  
> @@ -1908,18 +1911,19 @@ for x in effective_scanlist:
>  				(relative_path, len(myaux['DESCRIPTION']), max_desc_len))
>  
>  		keywords = myaux["KEYWORDS"].split()
> -		stable_keywords = []
> -		for keyword in keywords:
> -			if not keyword.startswith("~") and \
> -				not keyword.startswith("-"):
> -				stable_keywords.append(keyword)
> -		if stable_keywords:
> -			if ebuild_path in new_ebuilds and catdir != "virtual":
> -				stable_keywords.sort()
> -				stats["KEYWORDS.stable"] += 1
> -				fails["KEYWORDS.stable"].append(
> -					x + "/" + y + ".ebuild added with stable keywords: %s" % \
> -						" ".join(stable_keywords))
> +		if not options.straight_to_stable:
> +		    stable_keywords = []
> +		    for keyword in keywords:
> +			    if not keyword.startswith("~") and \
> +				    not keyword.startswith("-"):
> +				    stable_keywords.append(keyword

The indents above mix spaces with tabs.

> +		    if stable_keywords:
> +			    if ebuild_path in new_ebuilds and catdir != "virtual":
> +				    stable_keywords.sort()
> +				    stats["KEYWORDS.stable"] += 1
> +				    fails["KEYWORDS.stable"].append(
> +					    x + "/" + y + ".ebuild added with stable keywords: %s" % \
> +						    " ".join(stable_keywords))

In this scope, the relative_path variable is equivalent to x + "/" + y +
".ebuild", so you could use that instead.

>  
>  		ebuild_archs = set(kw.lstrip("~") for kw in keywords \
>  			if not kw.startswith("-"))
> 


-- 
Thanks,
Zac


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

* [gentoo-portage-dev] [PATCH v2] repoman: add --straight-to-stable (-S) option
  2015-03-24 18:06 ` Zac Medico
@ 2015-03-25  8:12   ` Michał Górny
  2015-03-25 17:05     ` Brian Dolbec
  0 siblings, 1 reply; 4+ messages in thread
From: Michał Górny @ 2015-03-25  8:12 UTC (permalink / raw
  To: gentoo-portage-dev; +Cc: Michał Górny

Add an option to safely allow committing ebuilds straight to stable.
Before, this required either round trips with multiple commits or
--force option that ignored valid QA concerns and (surprisingly to many
developers) skipped some expensive QA checks.
---
 bin/repoman | 28 ++++++++++++++++------------
 1 file changed, 16 insertions(+), 12 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index 13c220d..7101a00 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -191,6 +191,9 @@ def ParseArgs(argv, qahelp):
 	parser.add_argument('-f', '--force', dest='force', default=False, action='store_true',
 		help='Commit with QA violations')
 
+	parser.add_argument('-S', '--straight-to-stable', dest='straight_to_stable', default=False,
+		action='store_true', help='Allow committing straight to stable')
+
 	parser.add_argument('--vcs', dest='vcs',
 		help='Force using specific VCS instead of autodetection')
 
@@ -1908,18 +1911,19 @@ for x in effective_scanlist:
 				(relative_path, len(myaux['DESCRIPTION']), max_desc_len))
 
 		keywords = myaux["KEYWORDS"].split()
-		stable_keywords = []
-		for keyword in keywords:
-			if not keyword.startswith("~") and \
-				not keyword.startswith("-"):
-				stable_keywords.append(keyword)
-		if stable_keywords:
-			if ebuild_path in new_ebuilds and catdir != "virtual":
-				stable_keywords.sort()
-				stats["KEYWORDS.stable"] += 1
-				fails["KEYWORDS.stable"].append(
-					x + "/" + y + ".ebuild added with stable keywords: %s" % \
-						" ".join(stable_keywords))
+		if not options.straight_to_stable:
+			stable_keywords = []
+			for keyword in keywords:
+				if not keyword.startswith("~") and \
+					not keyword.startswith("-"):
+					stable_keywords.append(keyword)
+			if stable_keywords:
+				if ebuild_path in new_ebuilds and catdir != "virtual":
+					stable_keywords.sort()
+					stats["KEYWORDS.stable"] += 1
+					fails["KEYWORDS.stable"].append(
+						relative_path + " added with stable keywords: %s" % \
+							" ".join(stable_keywords))
 
 		ebuild_archs = set(kw.lstrip("~") for kw in keywords \
 			if not kw.startswith("-"))
-- 
2.3.3



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

* Re: [gentoo-portage-dev] [PATCH v2] repoman: add --straight-to-stable (-S) option
  2015-03-25  8:12   ` [gentoo-portage-dev] [PATCH v2] " Michał Górny
@ 2015-03-25 17:05     ` Brian Dolbec
  0 siblings, 0 replies; 4+ messages in thread
From: Brian Dolbec @ 2015-03-25 17:05 UTC (permalink / raw
  To: gentoo-portage-dev

On Wed, 25 Mar 2015 09:12:24 +0100
Michał Górny <mgorny@gentoo.org> wrote:

> Add an option to safely allow committing ebuilds straight to stable.
> Before, this required either round trips with multiple commits or
> --force option that ignored valid QA concerns and (surprisingly to
> many developers) skipped some expensive QA checks.
> ---
>  bin/repoman | 28 ++++++++++++++++------------
>  1 file changed, 16 insertions(+), 12 deletions(-)
> 
> diff --git a/bin/repoman b/bin/repoman
> index 13c220d..7101a00 100755
> --- a/bin/repoman
> +++ b/bin/repoman
> @@ -191,6 +191,9 @@ def ParseArgs(argv, qahelp):
>  	parser.add_argument('-f', '--force', dest='force',
> default=False, action='store_true', help='Commit with QA violations')
>  
> +	parser.add_argument('-S', '--straight-to-stable',
> dest='straight_to_stable', default=False,
> +		action='store_true', help='Allow committing straight
> to stable') +
>  	parser.add_argument('--vcs', dest='vcs',
>  		help='Force using specific VCS instead of
> autodetection') 
> @@ -1908,18 +1911,19 @@ for x in effective_scanlist:
>  				(relative_path,
> len(myaux['DESCRIPTION']), max_desc_len)) 
>  		keywords = myaux["KEYWORDS"].split()
> -		stable_keywords = []
> -		for keyword in keywords:
> -			if not keyword.startswith("~") and \
> -				not keyword.startswith("-"):
> -				stable_keywords.append(keyword)
> -		if stable_keywords:
> -			if ebuild_path in new_ebuilds and catdir !=
> "virtual":
> -				stable_keywords.sort()
> -				stats["KEYWORDS.stable"] += 1
> -				fails["KEYWORDS.stable"].append(
> -					x + "/" + y + ".ebuild added
> with stable keywords: %s" % \
> -						"
> ".join(stable_keywords))
> +		if not options.straight_to_stable:
> +			stable_keywords = []
> +			for keyword in keywords:
> +				if not keyword.startswith("~") and \
> +					not keyword.startswith("-"):
> +
> stable_keywords.append(keyword)
> +			if stable_keywords:
> +				if ebuild_path in new_ebuilds and
> catdir != "virtual":
> +					stable_keywords.sort()
> +					stats["KEYWORDS.stable"] += 1
> +
> fails["KEYWORDS.stable"].append(
> +						relative_path + "
> added with stable keywords: %s" % \
> +							"
> ".join(stable_keywords)) 
>  		ebuild_archs = set(kw.lstrip("~") for kw in keywords
> \ if not kw.startswith("-"))

LGTM thanks

-- 
Brian Dolbec <dolsen>



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

end of thread, other threads:[~2015-03-25 17:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-24  9:10 [gentoo-portage-dev] [PATCH] repoman: add --straight-to-stable (-S) option Michał Górny
2015-03-24 18:06 ` Zac Medico
2015-03-25  8:12   ` [gentoo-portage-dev] [PATCH v2] " Michał Górny
2015-03-25 17:05     ` Brian Dolbec

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox