Date: Wed, 18 Oct 2006 16:52:56 +0330 From: "Babak Farrokhi" <babak@farrokhi.net> To: "FreeBSD gnats submit" <FreeBSD-gnats-submit@FreeBSD.org> Subject: misc/104533: [patch] make send-pr(1) read configuration from ~/.sendprrc directory Message-ID: <1161177776.12552@starfish.farrokhi.net> Resent-Message-ID: <200610181330.k9IDUHTE008511@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>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@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:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1161177776.12552>