Bug 178539 - [PATCH] ports-mgmt/porttools: Improve commit sub-command
Summary: [PATCH] ports-mgmt/porttools: Improve commit sub-command
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-05-12 19:20 UTC by TAKATSU Tomonari
Modified: 2013-06-22 12:34 UTC (History)
1 user (show)

See Also:


Attachments
porttools-0.99_8.patch (2.81 KB, patch)
2013-05-12 19:20 UTC, TAKATSU Tomonari
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description TAKATSU Tomonari freebsd_committer freebsd_triage 2013-05-12 19:06:01 UTC
>Number:         178539
>Category:       ports
>Synopsis:       [PATCH] ports-mgmt/porttools: Improve commit sub-command
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sun May 12 18:20:00 UTC 2013
>Closed-Date:
>Last-Modified:
>Originator:     TAKATSU Tomonari
>Release:        FreeBSD 8.2-RELEASE-p9 amd64
>Organization:
none (private)
>Environment:
System: FreeBSD photon.local.lan 8.2-RELEASE-p9 FreeBSD 8.2-RELEASE-p9 #0: Mon Jun 11 23:00:11 UTC 2012
>Description:
- Improve commit sub-command
 * Fix the conditional statement of checking the result of svn status
 * Make use of addport with -c option
 * Make use of svn commit with -F option
 * Cosmetic change

Port maintainer (joemann@beefree.free.de) is cc'd.

Generated with FreeBSD Port Tools 0.99_8 (mode: change, diff: SVN)
>How-To-Repeat:
>Fix:

--- porttools-0.99_8.patch begins here ---
Index: Makefile
===================================================================
--- Makefile	(revision 317971)
+++ Makefile	(working copy)
@@ -3,7 +3,7 @@
 
 PORTNAME=	porttools
 PORTVERSION=	0.99
-PORTREVISION=	7
+PORTREVISION=	8
 CATEGORIES=	ports-mgmt
 MASTER_SITES=	SF
 
Index: files/patch-cmd_commit.in
===================================================================
--- files/patch-cmd_commit.in	(revision 317971)
+++ files/patch-cmd_commit.in	(working copy)
@@ -1,5 +1,5 @@
 --- cmd_commit.in.orig	2009-09-10 04:59:59.000000000 +0900
-+++ cmd_commit.in	2012-12-31 21:42:13.000000000 +0900
++++ cmd_commit.in	2013-04-27 07:26:46.000000000 +0900
 @@ -1,6 +1,6 @@
  # cmd_commit
  # Module for port(1)
@@ -8,13 +8,16 @@
  #
  # $Id: cmd_commit.in,v 1.2 2009/09/09 19:58:30 skolobov Exp $
  #
-@@ -59,13 +59,14 @@
+@@ -59,13 +59,17 @@
  
  # Determine if this is a new port
  MODE="update"
 -[ "`grep '\$FreeBSD: ' Makefile`" ] || MODE="new"
 +svn status Makefile 2>&1 1>/dev/null | grep -qs 'svn: warning: W155007:'
-+[ $? -eq 0 ] || [ "`grep '\$FreeBSD: ' Makefile`" ] || MODE="new"
++if [ $? -eq 0 ]
++then
++	MODE="new"
++fi
  
  # Run portlint(1) to validate port's sanity
  echo "===> Pre-commit portlint check"
@@ -25,13 +28,30 @@
  portlint ${FLAGS}
  if [ $? -ne 0 ]
  then
-@@ -79,15 +80,12 @@
+@@ -74,21 +78,25 @@
+ fi
+ 
+ 
+-PORTSDIR="`make -V PORTSDIR`"
++# See if SVN message already exists, and use that for commit log
++MSG="svn-msg"
++FLAGS=""
++
+ if [ "${MODE}" = "new" ]
  then
- 	${PORTSDIR}/Tools/scripts/addport -d `pwd` -u ${FREEFALL_USERNAME}
- else
+-	${PORTSDIR}/Tools/scripts/addport -d `pwd` -u ${FREEFALL_USERNAME}
+-else
 -	# Initialize CVS environment
 -	PCVS="cvs -d ${FREEFALL_USERNAME}@pcvs.FreeBSD.org:/home/pcvs"
--
++	PORTSDIR="`make -V PORTSDIR`"
+ 
++	if [ -e ${MSG} ]
++	then
++		FLAGS="-c ${MSG}"
++	fi
++
++	${PORTSDIR}/Tools/scripts/addport -d `pwd` -u ${FREEFALL_USERNAME} ${FLAGS}
++else
  	# Make sure we are working with up-to-date version
 -	echo "===> Pre-commit CVS update"
 -	${PCVS} update
@@ -40,12 +60,11 @@
  
 -	# See if CVS message already exists, and use that for commit log
 -	MSG="cvs-msg"
-+	# See if SVN message already exists, and use that for commit log
-+	MSG="svn-msg"
- 	FLAGS=""
+-	FLAGS=""
  	if [ -e ${MSG} ]
  	then
-@@ -99,16 +97,16 @@
+ 		FLAGS="-F ${MSG}"
+@@ -99,18 +107,18 @@
  			echo '============================================='
  			cat ${MSG}
  			echo '============================================='
@@ -61,7 +80,10 @@
 +	svn commit ${FLAGS}
  	
 -	# Remove CVS message file only if commit was successful
-+	# Remove SVN message file only if commit was successful
- 	[ $? -eq 0 -a -e ${MSG} ] && rm ${MSG}
+-	[ $? -eq 0 -a -e ${MSG} ] && rm ${MSG}
  fi
++# Remove SVN message file only if commit was successful
++[ $? -eq 0 -a -e ${MSG} ] && rm ${MSG}
  
+ echo "===> Done"
+ exit 0
--- porttools-0.99_8.patch ends here ---

>Release-Note:
>Audit-Trail:
>Unformatted:
_______________________________________________
freebsd-ports-bugs@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports-bugs
To unsubscribe, send any mail to "freebsd-ports-bugs-unsubscribe@freebsd.org"
Comment 1 TAKATSU Tomonari freebsd_committer freebsd_triage 2013-05-12 19:20:00 UTC
- Improve commit sub-command
 * Fix the conditional statement of checking the result of svn status
 * Make use of addport with -c option
 * Make use of svn commit with -F option
 * Cosmetic change

Port maintainer (joemann@beefree.free.de) is cc'd.

Generated with FreeBSD Port Tools 0.99_8 (mode: change, diff: SVN)
Comment 2 Edwin Groothuis freebsd_committer freebsd_triage 2013-05-12 19:20:07 UTC
Maintainer of ports-mgmt/porttools,

Please note that PR ports/178539 has just been submitted.

If it contains a patch for an upgrade, an enhancement or a bug fix
you agree on, reply to this email stating that you approve the patch
and a committer will take care of it.

The full text of the PR can be found at:
    http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/178539

-- 
Edwin Groothuis via the GNATS Auto Assign Tool
edwin@FreeBSD.org
Comment 3 Edwin Groothuis freebsd_committer freebsd_triage 2013-05-12 19:20:08 UTC
State Changed
From-To: open->feedback

Awaiting maintainers feedback (via the GNATS Auto Assign Tool)
Comment 4 dfilter service freebsd_committer freebsd_triage 2013-06-22 12:14:41 UTC
Author: tota
Date: Sat Jun 22 11:14:34 2013
New Revision: 321565
URL: http://svnweb.freebsd.org/changeset/ports/321565

Log:
  - Improve commit sub-command
    * Fix the conditional statement of checking the result of svn status
    * Make use of addport with -c option
    * Make use of svn commit with -F option
    * Cosmetic change
  
  PR:		ports/178539
  Submitted by:	tota (myself)
  Approved by:	maintainer timeout (> 1 month)

Modified:
  head/ports-mgmt/porttools/Makefile
  head/ports-mgmt/porttools/files/patch-cmd_commit.in

Modified: head/ports-mgmt/porttools/Makefile
==============================================================================
--- head/ports-mgmt/porttools/Makefile	Sat Jun 22 11:04:17 2013	(r321564)
+++ head/ports-mgmt/porttools/Makefile	Sat Jun 22 11:14:34 2013	(r321565)
@@ -3,7 +3,7 @@
 
 PORTNAME=	porttools
 PORTVERSION=	0.99
-PORTREVISION=	7
+PORTREVISION=	8
 CATEGORIES=	ports-mgmt
 MASTER_SITES=	SF
 

Modified: head/ports-mgmt/porttools/files/patch-cmd_commit.in
==============================================================================
--- head/ports-mgmt/porttools/files/patch-cmd_commit.in	Sat Jun 22 11:04:17 2013	(r321564)
+++ head/ports-mgmt/porttools/files/patch-cmd_commit.in	Sat Jun 22 11:14:34 2013	(r321565)
@@ -1,5 +1,5 @@
 --- cmd_commit.in.orig	2009-09-10 04:59:59.000000000 +0900
-+++ cmd_commit.in	2012-12-31 21:42:13.000000000 +0900
++++ cmd_commit.in	2013-04-27 07:26:46.000000000 +0900
 @@ -1,6 +1,6 @@
  # cmd_commit
  # Module for port(1)
@@ -8,13 +8,16 @@
  #
  # $Id: cmd_commit.in,v 1.2 2009/09/09 19:58:30 skolobov Exp $
  #
-@@ -59,13 +59,14 @@
+@@ -59,13 +59,17 @@
  
  # Determine if this is a new port
  MODE="update"
 -[ "`grep '\$FreeBSD: ' Makefile`" ] || MODE="new"
 +svn status Makefile 2>&1 1>/dev/null | grep -qs 'svn: warning: W155007:'
-+[ $? -eq 0 ] || [ "`grep '\$FreeBSD: ' Makefile`" ] || MODE="new"
++if [ $? -eq 0 ]
++then
++	MODE="new"
++fi
  
  # Run portlint(1) to validate port's sanity
  echo "===> Pre-commit portlint check"
@@ -25,13 +28,30 @@
  portlint ${FLAGS}
  if [ $? -ne 0 ]
  then
-@@ -79,15 +80,12 @@
+@@ -74,21 +78,25 @@
+ fi
+ 
+ 
+-PORTSDIR="`make -V PORTSDIR`"
++# See if SVN message already exists, and use that for commit log
++MSG="svn-msg"
++FLAGS=""
++
+ if [ "${MODE}" = "new" ]
  then
- 	${PORTSDIR}/Tools/scripts/addport -d `pwd` -u ${FREEFALL_USERNAME}
- else
+-	${PORTSDIR}/Tools/scripts/addport -d `pwd` -u ${FREEFALL_USERNAME}
+-else
 -	# Initialize CVS environment
 -	PCVS="cvs -d ${FREEFALL_USERNAME}@pcvs.FreeBSD.org:/home/pcvs"
--
++	PORTSDIR="`make -V PORTSDIR`"
+ 
++	if [ -e ${MSG} ]
++	then
++		FLAGS="-c ${MSG}"
++	fi
++
++	${PORTSDIR}/Tools/scripts/addport -d `pwd` -u ${FREEFALL_USERNAME} ${FLAGS}
++else
  	# Make sure we are working with up-to-date version
 -	echo "===> Pre-commit CVS update"
 -	${PCVS} update
@@ -40,12 +60,11 @@
  
 -	# See if CVS message already exists, and use that for commit log
 -	MSG="cvs-msg"
-+	# See if SVN message already exists, and use that for commit log
-+	MSG="svn-msg"
- 	FLAGS=""
+-	FLAGS=""
  	if [ -e ${MSG} ]
  	then
-@@ -99,16 +97,16 @@
+ 		FLAGS="-F ${MSG}"
+@@ -99,18 +107,18 @@
  			echo '============================================='
  			cat ${MSG}
  			echo '============================================='
@@ -61,7 +80,10 @@
 +	svn commit ${FLAGS}
  	
 -	# Remove CVS message file only if commit was successful
-+	# Remove SVN message file only if commit was successful
- 	[ $? -eq 0 -a -e ${MSG} ] && rm ${MSG}
+-	[ $? -eq 0 -a -e ${MSG} ] && rm ${MSG}
  fi
++# Remove SVN message file only if commit was successful
++[ $? -eq 0 -a -e ${MSG} ] && rm ${MSG}
  
+ echo "===> Done"
+ exit 0
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 5 TAKATSU Tomonari freebsd_committer freebsd_triage 2013-06-22 12:33:42 UTC
State Changed
From-To: feedback->closed

Committed. Thanks!