[PATCH] ports-mgmt/porttools: add submit -P to print PR

John Hein jhein at symmetricom.com
Fri Feb 10 17:00:38 UTC 2012


>Submitter-Id:	current-users
>Originator:	John Hein
>Organization:	
>Confidential:	no 
>Synopsis:	[PATCH] ports-mgmt/porttools: add submit -P to print PR
>Severity:	non-critical
>Priority:	low
>Category:	ports 
>Class:		change-request
>Release:
>Environment:
>Description:

Add -P to print PR to stdout instead of submitting.  This allows the
sender to verify the PR before sending and possibly save the output to
paste into a mail client when an automated mailer (sendmail or some
other mailer to stuff in MAIL_AGENT) is unavailable or impractical to
use.

Also fix the comment in patch-cmd_submit.in that said support for
PORTEPOCH was added (looks like all of ports/154809 was not applied).
However it would probably be simpler to just remove the
PORTREVISION/PORTVERSION/PORTEPOCH logic used in port/154809 and just
use PKGNAME instead.

I'm ignoring the whitespace style mistakes in the PORTREVISION change
in patch-cmd_submit.in, but the committer could fix that if she feels
so inclined (and doesn't just refactor to use PKGNAME).


Added file(s):
- files/patch-port.1

Generated with FreeBSD Port Tools 0.99
>How-To-Repeat:
>Fix:

--- porttools-0.99_3.patch begins here ---
Index: Makefile
===================================================================
RCS file: /base/FreeBSD-CVS/ports/ports-mgmt/porttools/Makefile,v
retrieving revision 1.28
diff -u -p -u -r1.28 Makefile
--- Makefile	30 Oct 2011 20:29:53 -0000	1.28
+++ Makefile	10 Feb 2012 16:09:21 -0000
@@ -7,7 +7,7 @@
 
 PORTNAME=	porttools
 PORTVERSION=	0.99
-PORTREVISION=	2
+PORTREVISION=	3
 CATEGORIES=	ports-mgmt
 MASTER_SITES=	SF
 
Index: files/patch-cmd_submit.in
===================================================================
RCS file: /base/FreeBSD-CVS/ports/ports-mgmt/porttools/files/patch-cmd_submit.in,v
retrieving revision 1.1
diff -u -p -u -r1.1 patch-cmd_submit.in
--- files/patch-cmd_submit.in	30 Oct 2011 20:29:53 -0000	1.1
+++ files/patch-cmd_submit.in	7 Feb 2012 19:36:05 -0000
@@ -1,12 +1,43 @@
 $FreeBSD: ports/ports-mgmt/porttools/files/patch-cmd_submit.in,v 1.1 2011/10/30 20:29:53 crees Exp $
 
-From bugs.freebsd.org/154809
+Porttools will now include PORTREVISION in PRs sent (bugs.freebsd.org/154809).
 
-Porttools will now include PORTREVISION and PORTEPOCH in PRs sent
+Add -P to print PR to stdout instead of submitting.
 
---- cmd_submit.in.old	2011-02-15 12:55:54.000000000 -0800
-+++ cmd_submit.in	2011-02-15 12:59:51.000000000 -0800
-@@ -146,6 +146,7 @@
+
+--- cmd_submit.in.orig	2009-09-09 13:59:59.000000000 -0600
++++ cmd_submit.in	2012-02-07 11:55:39.000000000 -0700
+@@ -30,6 +30,7 @@
+ 		<pattern> - against original port in <pwd><pattern>
+ 	-s <severity> - Set PR's severity to <severity>
+ 	-p <priority> - Set PR's priority to <priority>
++	-P	- Don't send the PR; print to stdout (see -P in send-pr(1))
+ 	-c	- committer mode: more portlint(1) checks
+ 	-L	- Skip running portlint(1)
+ EOF
+@@ -41,9 +42,10 @@
+ PRIORITY="low"
+ COMMITTER="no"
+ RUN_PORTLINT="yes"
++SENDPR_ARGS=
+ 
+ # Parse command line arguments
+-ARGS=`/usr/bin/getopt hm:d:s:p:cL $*`
++ARGS=`/usr/bin/getopt hm:d:s:p:cLP $*`
+ if [ $? != 0 ]
+ then
+ 	echo "Error: invalid arguments"
+@@ -116,6 +118,9 @@
+ 	-L)
+ 		RUN_PORTLINT="no"
+ 		;;
++	-P)
++		SENDPR_ARGS="$SENDPR_ARGS -P"
++		;;
+ 	esac
+ 	shift
+ done
+@@ -146,6 +151,7 @@
  # Collect information about the port
  PORTNAME="`make -V PKGNAMEPREFIX``make -V PORTNAME``make -V PKGNAMESUFFIX`"
  PORTVERSION="`make -V PORTVERSION`"
@@ -14,7 +45,7 @@ Porttools will now include PORTREVISION 
  PKGNAME="`make -V PKGNAME`"
  CATEGORY="`make -V CATEGORIES | sed -E 's/^([^ ]+).*$/\1/'`"
  MAINTAINER="`make -V MAINTAINER`"
-@@ -194,8 +195,14 @@
+@@ -194,8 +200,14 @@
  		# Override some parameters if submitting an update to a newer
  		# version of an existing port
  		CLASS="update"
@@ -29,3 +60,12 @@ Porttools will now include PORTREVISION 
  	fi
  	
  	# Check to see if maintainership was requested
+@@ -333,7 +345,7 @@
+ 
+ # Invoke send-pr(1)
+ echo "===> Invoking send-pr(1) to submit a PR"
+-PR_FORM="${PR_FORM}" /usr/bin/send-pr -a ${PATCH}
++PR_FORM="${PR_FORM}" /usr/bin/send-pr -a ${PATCH} ${SENDPR_ARGS}
+ if [ $? -ne 0 ]
+ then
+ 	echo "Error submitting PR"
Index: files/patch-port.1
===================================================================
RCS file: files/patch-port.1
diff -N files/patch-port.1
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ files/patch-port.1	10 Feb 2012 15:22:24 -0000
@@ -0,0 +1,15 @@
+$FreeBSD$
+
+--- port.1.orig	2009-09-09 13:59:59.000000000 -0600
++++ port.1	2012-02-10 08:19:49.000000000 -0700
+@@ -245,6 +245,10 @@
+ Skips running
+ .Xr portlint 1 .
+ Using this option will generate a warning and it strongly discouraged.
++.It Fl P
++Don't send the PR.
++Just print to stdout (see -P in
++.Xr send-pr 1) .
+ .El
+ .It Ar test
+ Automates the process of testing a new port (or a port update) 
--- porttools-0.99_3.patch ends here ---


More information about the freebsd-ports mailing list