From 86eaf5e03289e45a95514b4f6011157972016e9d Mon Sep 17 00:00:00 2001 From: fuzzyray Date: Thu, 30 Apr 2009 21:52:45 +0000 Subject: Tagging the gentoolkit-0.2.4 release svn path=/tags/gentoolkit-0.2.4/; revision=564 --- src/eviewcvs/AUTHORS | 1 + src/eviewcvs/Makefile | 22 +++++++++++ src/eviewcvs/README | 11 ++++++ src/eviewcvs/eviewcvs | 95 +++++++++++++++++++++++++++++++++++++++++++++++ src/eviewcvs/eviewcvs.pod | 48 ++++++++++++++++++++++++ 5 files changed, 177 insertions(+) create mode 100644 src/eviewcvs/AUTHORS create mode 100644 src/eviewcvs/Makefile create mode 100644 src/eviewcvs/README create mode 100755 src/eviewcvs/eviewcvs create mode 100644 src/eviewcvs/eviewcvs.pod (limited to 'src/eviewcvs') diff --git a/src/eviewcvs/AUTHORS b/src/eviewcvs/AUTHORS new file mode 100644 index 0000000..36d5bfd --- /dev/null +++ b/src/eviewcvs/AUTHORS @@ -0,0 +1 @@ +Aron Griffis diff --git a/src/eviewcvs/Makefile b/src/eviewcvs/Makefile new file mode 100644 index 0000000..ee4208f --- /dev/null +++ b/src/eviewcvs/Makefile @@ -0,0 +1,22 @@ +# Copyright 2005 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License v2 +# +# $Header$ + +include ../../makedefs.mak + +%.1 : %.pod + pod2man $< > $@ + +.PHONY: all +all: eviewcvs.1 + +dist: eviewcvs.1 + mkdir -p ../../$(distdir)/src/eviewcvs/ + cp Makefile AUTHORS README eviewcvs eviewcvs.pod eviewcvs.1 ../../$(distdir)/src/eviewcvs/ + +install: all + install -m 0755 eviewcvs $(bindir)/ + install -d $(docdir)/eviewcvs + install -m 0644 AUTHORS README $(docdir)/eviewcvs/ + install -m 0644 eviewcvs.1 $(mandir)/ diff --git a/src/eviewcvs/README b/src/eviewcvs/README new file mode 100644 index 0000000..c7258d7 --- /dev/null +++ b/src/eviewcvs/README @@ -0,0 +1,11 @@ +Most of the documentation is contained in the man-page, which you can +read directly (using GNU man) by doing + + man ./eviewcvs.1 + +To rebuild the man-page from pod source, do + + pod2man --name=eviewcvs --center='Gentoolkit' \ + eviewcvs.pod eviewcvs.1 + +03 Nov 2004 agriffis diff --git a/src/eviewcvs/eviewcvs b/src/eviewcvs/eviewcvs new file mode 100755 index 0000000..280ec0b --- /dev/null +++ b/src/eviewcvs/eviewcvs @@ -0,0 +1,95 @@ +#!/bin/bash +# $Id$ +# +# Copyright 2005, Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# Written by Aron Griffis +# +# eviewcvs - generate viewcvs urls for some files +# + +if [[ -t 1 ]]; then + blue="" + cyan="" + green="" + red="" + off="" +else + unset blue cyan green red off +fi + +startdir="$PWD" +url="http://sources.gentoo.org/viewcvs.py" +unset diffs +declare -a hdr orev + +chdir() { + cd "$1" || return + + # Figure out where we are, hopefully + unset cwd root + if [[ -f CVS/Repository ]]; then + cwd=$(/dev/null | awk '/^head:/{print $2}') + elif [[ -d .svn ]]; then + frev=$(svn info "$f" 2>/dev/null | awk '/^Revision:/{print $2}') + fi + ;; + esac + [[ -n ${frev} ]] || continue + + # Here is the simple URL to view it + echo "${url}/${fwd:+$fwd/}${green}${f}${off}?rev=${frev}&view=markup" + + # Also supply a diff URL if possible + if [[ ${frev##*.} -gt 1 ]]; then + orev=( ${frev//./ } ) # convert to array + (( orev[${#orev[@]}-1]-- )) # decrement the last element + orev=${orev[*]} # convert to string + orev=${orev// /.} # revert spaces to dots + diffs="${diffs:+$diffs +}${url}/${fwd:+$fwd/}${blue}${f}${off}?r1=${orev}&r2=${frev}" + fi +done + +if [[ -n ${diffs} ]]; then + echo "${diffs}" +fi + +# vim:set expandtab sw=4 smarttab: diff --git a/src/eviewcvs/eviewcvs.pod b/src/eviewcvs/eviewcvs.pod new file mode 100644 index 0000000..b4403c8 --- /dev/null +++ b/src/eviewcvs/eviewcvs.pod @@ -0,0 +1,48 @@ +=head1 NAME + +eviewcvs - Gentoo: generate viewcvs URLs + +=head1 SYNOPSIS + +eviewcvs [ I ] + +=head1 DESCRIPTION + +This tool generates a list of viewcvs URLs based on the files listed, or all the +files in the current directory if the file list is omitted. The first part of +the output, hilighted in green, is the simple URLs to view the files. The +second part of the output, hilighted in blue, is the URLs to view the diffs +against the previous revision. + +=head1 OPTIONS + +Presently eviewcvs is simple enough that it supplies no options. +Probably I'll add B<--help> and B<--version> in the future, but for +now it's enough to track the gentoolkit version. + +=head1 EXAMPLES + +To generate viewcvs URLs for a given file: + + $ eviewcvs package.mask + http://www.gentoo.org/cgi-bin/viewcvs.cgi/profiles/package.mask?rev=1.3716&content-type=text/vnd.viewcvs-markup + http://www.gentoo.org/cgi-bin/viewcvs.cgi/profiles/package.mask?r1=1.3715&r2=1.3716 + +To generate viewcvs URLs for all files in a directory: + + $ cd portage/net-misc/keychain + $ eviewcvs + http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/keychain/ChangeLog?rev=1.54&view=markup + http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/keychain/Manifest?rev=1.86&view=markup + http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/keychain/keychain-2.6.1.ebuild?rev=1.3&view=markup + http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/keychain/keychain-2.6.2.ebuild?rev=1.1&view=markup + http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/keychain/metadata.xml?rev=1.3&view=markup + http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/keychain/ChangeLog?r1=1.53&r2=1.54 + http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/keychain/Manifest?r1=1.85&r2=1.86 + http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/keychain/keychain-2.6.1.ebuild?r1=1.2&r2=1.3 + http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/keychain/metadata.xml?r1=1.2&r2=1.3 + +=head1 AUTHOR + +This tool was written by Aron Griffis . Bugs +found should be filed against me at http://bugs.gentoo.org/ -- cgit v1.2.3-65-gdbad