misc/104533: [patch] make send-pr(1) read configuration from ~/.sendprrc directory

Babak Farrokhi babak at farrokhi.net
Wed Oct 18 06:30:18 PDT 2006


>Number:         104533
>Category:       misc
>Synopsis:       [patch] make send-pr(1) read configuration from ~/.sendprrc directory
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Oct 18 13:30:16 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Babak Farrokhi
>Release:        FreeBSD 6.2-PRERELEASE i386
>Organization:
>Environment:


System: FreeBSD 6.2-PRERELEASE #0: Fri Sep 22 14:10:00 IRST 2006
    root at starfish.datak.net:/usr/obj/usr/src/sys/STARFISH



>Description:


This patch make send-pr(1) read some user-specific configuration from ~/.sendprrc directory. 

~/.sendprrc/name
~/.sendprrc/email
~/.sendprrc/organization



>How-To-Repeat:





>Fix:


--- send-pr.patch begins here ---
diff -ruN send-pr.orig/send-pr.sh send-pr/send-pr.sh
--- send-pr.orig/send-pr.sh	Tue Oct 10 16:37:22 2006
+++ send-pr/send-pr.sh	Wed Oct 11 11:27:12 2006
@@ -39,6 +39,9 @@
 # Where the gnats category tree lives.
 DATADIR=@DATADIR@
 
+# Where user-specific configuration lives
+RCDIR=$HOME/.sendprrc
+
 # If we've been moved around, try using GCC_EXEC_PREFIX.
 [ ! -d $DATADIR/gnats -a -d "$GCC_EXEC_PREFIX" ] && DATADIR="$GCC_EXEC_PREFIX"
 
@@ -76,18 +79,32 @@
 
 #
 
+# find organization
+if [ -f $RCDIR/organization ]; then
+	DEFAULT_ORGANIZATION="`sed -e '1q' $RCDIR/organization`"
+fi	
+
+# find email address
+if [ -f $RCDIR/email ]; then
+	EMAIL="`sed -e '1q' $RCDIR/email`"
+fi
+
 # find a user name
-if [ "$LOGNAME" = "" ]; then
+if [ "$EMAIL" = "" ]; then
 	if [ "$USER" != "" ]; then
 		LOGNAME="$USER"
 	else
 		LOGNAME="UNKNOWN"
 	fi
+else
+	LOGNAME="$EMAIL"
 fi
 
 # Find out the name of the originator of this PR.
 if [ -n "$NAME" ]; then
   ORIGINATOR="$NAME"
+elif [ -f $RCDIR/name ]; then
+  ORIGINATOR="`sed -e '1q' $RCDIR/name`"
 elif [ -f $HOME/.fullname ]; then
   ORIGINATOR="`sed -e '1q' $HOME/.fullname`"
 else
--- send-pr.patch ends here ---



>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list