#!/bin/sh ## author: parv, parv UNDERSCORE AT yahoo DOT com ## date: aug 31 2001 ## ## license: free to use as you please w/ proper credit given ## ## name: cvstime ## ## purpose: get version number & date from cvsup checkout file ## ## usage: ## to get version/date for docproj ... ## cvstime doc ## ## to get version/date for the ports tree... ## cvstime port ## ## to get version/date for the src tree... ## cvstime src ## # change $DEFAULT_BASE, $BASE, and $MODULE as appropriate. these are # name sake variables as used in cvsup config file. # # needless to say, this script can be configured to check for any other # project that you may be tracking. see the "case" block. # # default location of cvsup checkout files DEFAULT_BASE=/misc # default tag DEFAULT_TAG=. # change $BASE & $MODULE as appropriate or your needs case $1 in port*) MODULE=ports-all ;; src*6 | src ) MODULE=src-all TAG=RELENG_6 ;; src*7 ) MODULE=src-all TAG=RELENG_7 ;; web|www) MODULE=www BASE="$HOME/cf/cvsup" ;; *) echo ' * incorrect argument given:' $1 echo ' * correct argument is one of: doc, docs, port, ports, src, source' exit 1 ;; esac FILE=${BASE:-$DEFAULT_BASE}/sup/${MODULE}/checkouts.cvs\:${TAG:-$DEFAULT_TAG} if [ ! -f $FILE -o ! -r $FILE ] then echo ' * ' $FILE either does not exist or is not readable. exit 1 else awk '/^C / {print $7, $2, $6}' $FILE | sort -bfi -t '.' -n -k 1 -n -k 2 -n -k 3 #-n -k 4 -n -k 5 -n -k 6 fi