ANNOUNCE: FreeBSD Port Tools 0.20

Jens Rehsack rehsack at liwing.de
Sun Jul 27 07:57:06 PDT 2003


On 27.07.2003 15:28, Sergei Kolobov wrote:

> INTRODUCTION
> ============
> 
> FreeBSD Port Tools consist of the following small /bin/sh scripts:
> - testport: automate testing a new port or a port update
> - pr-new: submit a PR for a new port
> - pr-update: submit a PR with a port update to a newer version
> - pr-change: submit a PR with a port change (but not update)

[...]

> NOTE: the Port Tools are currently in alpha state. 
> I would appreciate any feedback, comments or suggestions for improvement. 
> Patches are welcome.  Contact me at <sergei at kolobov.com>.
> 

Hi Sergei,

great idea to make such tools public. As long I don't work
everytime with cvs but with cvsup, too, I used attached script
with a patched send-pr. It seems not so good as yours but it
doesn't require "a working copy of the port checked out of CVS".
I rank that very high, maybe there is a way to combine both
ways.

Best,
Jens
-------------- next part --------------
#!/bin/sh

usage()
{
	cat <<EOF
Usage $0 [-e <file-expr>] [-l <relative location>]
	file-expr	expression to identify the modified file, eg. pkg-*
	relative
	  location	location relative to current dir to search within
EOF
	exit 1
}

newExpr="*"
location=""

while getopts l:e: options
do
	case $options in
		e)
			newExpr=$OPTARG
			;;
		l)
			location=$OPTARG
			;;
		h)
			usage;
			break;;
		\?)
			usage
			break;;
	esac
done

origExpr=${newExpr}.orig
base=`pwd`/
wd="${base}${location}"

for filename in `find ${wd} -name "${origExpr}"`
do
	fn=`echo ${filename}|sed "s|${base}||"`
	ofn=`echo ${fn}|sed "s/.orig//"`
	echo "Index: ${ofn}"
	echo "==================================================================="
	echo "diff -u ${fn} ${ofn}"
	diff -u ${fn} ${ofn}
done
-------------- next part --------------
#!/bin/sh

# $Id$

usage()
{
	cat <<EOF
Usage: $0 [-p <port-location>] [-c <carbon-copy>] [-a <patch-files-pattern>]
		[-l <class>] [-s <severity>] [-t <category>] [-o <priority>]
		[-u <username>] [-m <maildomain>]
	<port-location>		location of port in ports-tree (eg. lang/php4)
	<carbon-copy>		e-mail addresses to put in Cc: of mail
	<patch-files-pattern>	pattern to match the patch files
	<class>			one of [ sw-bug | doc-bug | change-request |
					update | maintainer-update ]
	<severity>		one of [ non-critical | serious | critical ]
	<category>		one of the entries from /etc/gnats/freefall
	<priority>		one of [ low | medium | high ]
	<user>			another user name, eg. when name differs
				from mail user name
	<maildomain>		another domain name for sending mail from/to
EOF
	exit 1
}

cc="Jens Rehsack <rehsack at liwing.de>"
organization="LiWing IT-Services"
severity="non-critical" # [ non-critical | serious | critical ]
priority="medium" # [ low | medium | high ]
category="ports" # </etc/gnats/freefall
class="change-request" # [ sw-bug | doc-bug | change-request | update | maintainer-update ]
maildomain="liwing.de"
user=${USER}

while getopts p:c:a:s:l:o:u:m:t: options
do
	case $options in
		p)
			port_path=$OPTARG ;;
		c)
			cc="${cc}, $OPTARG" ;;
		a)
			pfp=$OPTARG ;;
		l)
			class=$OPTARG ;;
		s)
			severity=$OPTARG ;;
		t)
			category=$OPTARG ;;
		o)
			priority=$OPTARG ;;
		u)
			user=$OPTARG ;;
		m)
			maildomain=$OPTARG ;;
		\?)
			usage
	esac
done

if [ -z "${pfp}" ]
then
	patch_pattern=patch-*
else
	patch_pattern=patch-*${pfp}*
fi

if [ "ports" = "${category}" ]
then
	patch_base=~root/patches
	patch_pattern=ports/${port_path}/${patch_pattern}
else
	patch_base=~root/patches/src
fi

patch_files=

for a in ${patch_base}/${patch_pattern}
do
	if [ -f ${a} ]
	then
		patch_files="${patch_files} -a ${a}"
	fi
done

if [ ! -d ~/pr-files ]
then
	mkdir ~/pr-files
fi

pr_file="${patch_pattern}-`date +%F`"
pr_file=`echo "${pr_file}" | sed "s|[/*-]|_|g" | sed "s/__/_/g"`
pr_file="${HOME}/pr-files/pr-${pr_file}"

touch ${pr_file}

env ORGANIZATION="${organization}" REPLY_TO="${user}@${maildomain}" \
	send-pr -c "${cc}" ${patch_files} --severity ${severity} \
		--priority ${priority} --category ${category} \
		--class ${class} --print > ${pr_file}

${EDITOR} ${pr_file}

echo "The PR to send is in ${pr_file}"
-------------- next part --------------
--- gnu/usr.bin/send-pr/send-pr.sh.orig	Sat Mar 22 10:31:24 2003
+++ gnu/usr.bin/send-pr/send-pr.sh	Wed Jun 25 09:58:02 2003
@@ -138,6 +138,9 @@
 BATCH=
 CC=
 SEVERITY_C=
+PRIORITY_C=
+CATEGORY_C=
+CLASS_C=
 
 while [ $# -gt 0 ]; do
   case "$1" in
@@ -160,6 +163,15 @@
     -s | --severity) if [ $# -eq 1 ]; then echo "$USAGE"; exit 1; fi
 	shift ; SEVERITY_C="$1"
 	;;
+    --priority) if [ $# -eq 1 ]; then echo "$USAGE"; exit 1; fi
+	shift ; PRIORITY_C="$1"
+	;;
+    --category) if [ $# -eq 1 ]; then echo "$USAGE"; exit 1; fi
+	shift ; CATEGORY_C="$1"
+	;;
+    --class) if [ $# -eq 1 ]; then echo "$USAGE"; exit 1; fi
+	shift ; CLASS_C="$1"
+	;;
     -p | -P | --print) PRINT=true ;;
     -L | --list) FORMAT=norm ;;
     -l | -CL | --lisp) FORMAT=lisp ;;
@@ -247,9 +259,15 @@
 if [ -z "$SEVERITY_C" ]; then
   SEVERITY_C='<[ non-critical | serious | critical ] (one line)>'
 fi
-PRIORITY_C='<[ low | medium | high ] (one line)>'
-CATEGORY_C='<choose from the list of categories above (one line)>'
-CLASS_C='<[ sw-bug | doc-bug | change-request | update | maintainer-update ] (one line)>'
+if [ -z "$PRIORITY_C" ]; then
+  PRIORITY_C='<[ low | medium | high ] (one line)>'
+fi
+if [ -z "$CATEGORY_C" ]; then
+  CATEGORY_C='<choose from the list of categories above (one line)>'
+fi
+if [ -z "$CLASS_C" ]; then
+  CLASS_C='<[ sw-bug | doc-bug | change-request | update | maintainer-update ] (one line)>'
+fi
 RELEASE_C='<release number or tag (one line)>'
 ENVIRONMENT_C='<machine, os, target, libraries (multiple lines)>'
 DESCRIPTION_C='<precise description of the problem (multiple lines)>'


More information about the freebsd-ports mailing list