2
#$Header: /sourceware/projects/lvm2-home/cvsfiles/LVM2/scripts/last_cvs_update.sh,v 1.2 2010/05/14 11:33:21 zkabelac Exp $
3
################################################################################
5
## Copyright 2001 Sistina Software, Inc.
7
## This is free software released under the GNU General Public License.
8
## There is no warranty for this software. See the file COPYING for
11
## See the file CONTRIBUTORS for a list of contributors.
13
## This file is maintained by:
14
## AJ Lewis <lewis@sistina.com>
16
## File name: last_cvs_update.sh
18
## Description: displays the last file updated by CVS commands and the date
19
## it was updated. May be given a relative or absolute path.
20
## Based on this information, you should be able to do a
21
## cvs co -D $date GFS and get the same version of the source
22
## tree as this tool was run on.
24
## Will also give you the CVS tag the source tree is based off
25
## off when appropriate
29
## The last file updated by CVS was:
34
################################################################################
40
then echo "usage: $0 [ -h | path ]"
46
echo "usage: $0 [ -h | path ]"
52
# grab the tag from the path passed in
53
if [[ -f $path/CVS/Tag ]];
54
then echo "Tag: " `cat $path/CVS/Tag | sed -e 's/^[NT]//'`
62
# find the path for the Entries file
64
sub(/^\.\//, "", path)
66
# remove the CVS part of it
67
sub(/CVS\/Entries/, "", path)
69
# add the path the the filename that was modified, and put the date it was
73
}' `find $path -name "Entries" -printf "%h/%f "` | awk '
74
# converts string name of month the a numeral
75
function cvt_month(month) {
113
date = $2 " " $3 " " $4 " " $5 " " $6
122
# then month if year is the same
123
if (cvt_month(maxmonth) < cvt_month($3)) {
124
date = $2 " " $3 " " $4 " " $5 " " $6
131
if (cvt_month(maxmonth) == cvt_month($3)) {
132
#then date if month is the same
134
date = $2 " " $3 " " $4 " " $5 " " $6
141
# then time if date is the same
143
date = $2 " " $3 " " $4 " " $5 " " $6
156
# strip leading "./" from filename
157
sub(/^\.\//, "", file)
158
print "The last file updated by CVS was:"