Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 17 May 2000 17:05:03 -0400
From:      Patrick Seal <patseal@hyperhost.net>
To:        freebsd-ports@freebsd.org
Subject:   WWW: script for maintainers
Message-ID:  <20000517170503.A13621@hyperhost.net>

next in thread | raw e-mail | index | archive | help
Here's a small sh(1) script I wrote that reads a config file with a list
of ports you maintain, extracts the WWW: and goes to each website. This
is handy for checking for newer versions.

If there is enough interest, I could make a port.

example .myports:

archivers/mscompress
astro/xtide
misc/boxes


myports.sh:

#!/bin/sh

# Copyright (c) 2000 Patrick Seal <patseal@hyperhost.net>
# All rights reserved.
#
# cat /usr/share/examples/etc/bsd-style-copyright


PORTSDIR=${PORTSDIR:=/usr/ports}
BROWSER="netscape"
PER_WEBSITES=5	# Number of websites per cmdline (think xargs)
CONFIG=~/.myports

while getopts ":vb:p:h" opt; do
	case $opt in
		v )	VERBOSE=1
		;;
		b )	BROWSER=$OPTARG
		;;
		p )	PORTSDIR=$OPTARG
		;;
		h | ? )	echo "usage: $0 [-v] [-b broswer] [-c configfile] [-p portsdir]"
		;;
	esac
done


while read port; do		# < $CONFIG
	www=`grep WWW: $PORTSDIR/$port/pkg/DESCR | cut -d ' ' -f 2`
	if [ -n "$www" ]; then
		if [ "$VERBOSE" ]; then	echo $www; fi
		websites="$websites $www"
	else
		echo "can't find \"WWW:\" for $port" >&2
	fi
done < $CONFIG


# Launch Browser
i=0
for website in $websites; do
	i=$(($i+1))
	if [ "$i" -lt "$PER_WEBSITES" ]; then
		cmdline="$cmdline $website" 
	elif [ "$i" -eq "$PER_WEBSITES" ]; then
		cmdline="$cmdline $website" 
		if [ "$VERBOSE" ]; then echo "$BROWSER $cmdline"; fi
		$BROWSER $cmdline
		i=0			# Reset loop
		cmdline=""	# Flush cmdline
	fi
done

# catch left-overs
if [ "$cmdline" != "" ]; then 
	if [ "$VERBOSE" ]; then echo "$BROWSER $cmdline"; fi
	$BROWSER $cmdline
fi

-- 
------------------------------------ _____________________________________
Patrick Seal                        |"Microsoft isn't evil, they just make
<patseal@hyperhost.net>             |   really crappy operating systems."
Hyperhost - http://www.hyperhost.net| -Linus Torvalds


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000517170503.A13621>