Vapier wrote: [Fri Mar 11 2005, 03:38:35PM EST] > or committing something to cvs and wishing there was a link you could pull up > in viewcvs to give to users when closing bugs rather than waiting around for > 30+ minutes for the changes to appear in viewcvs $ vc keychain* http://www.gentoo.org/cgi-bin/viewcvs.cgi/net-misc/keychain/keychain-2.5.1.ebuild?rev=1.3&content-type=text/vnd.viewcvs-markup http://www.gentoo.org/cgi-bin/viewcvs.cgi/net-misc/keychain/keychain-2.5.1.ebuild?r1=1.2&r2=1.3 http://www.gentoo.org/cgi-bin/viewcvs.cgi/net-misc/keychain/keychain-2.5.3.1.ebuild?rev=1.1&content-type=text/vnd.viewcvs-markup # vc: generate viewcvs urls from the current directory vc() { declare f rev cwd orevn declare -a orev [[ -n $* ]] || set -- * cwd=${PWD#*/portage} cwd=${cwd#*/gentoo-x86} cwd=${cwd#/} for f in "$@"; do [[ -f "$f" ]] || continue rev=$(egrep -m1 -o '\$(Header|Id):[^$]*\$' "$f") [[ -n $rev ]] && rev=$(echo "$rev" | cut -d' ' -f3) [[ -n $rev ]] || rev=$(cvs log "$f" 2>/dev/null | awk '/^head:/{print $2}') [[ -n $rev ]] || continue # oh well printf "%s/%s/%s?rev=%s&content-type=text/vnd.viewcvs-markup\n" \ "http://www.gentoo.org/cgi-bin/viewcvs.cgi" "$cwd" "$f" "$rev" if [[ $rev != *.1 ]]; then orev=( $(sed 's/\(.*\.\)\(.*\)/\1 \2/g' <<<"$rev") ) (( orev[1]-- )) printf "%s/%s/%s?r1=%s&r2=%s\n" "http://www.gentoo.org/cgi-bin/viewcvs.cgi" \ "$cwd" "$f" "${orev[0]}${orev[1]}" "$rev" fi done } -- Aron Griffis Gentoo Linux Developer