# kenstir@viewlogic.com
# ...!harvard!cg-atla!viewlog!kenstir
#
-# I added some portability fixes and the -u option. More importantly,
+# 1.1: I added some portability fixes and the -u option. More importantly,
# I removed the dependencies on the BSD/SV `sccs' utility; this script
# will now work on any system that has the base SCCS/RCS tools available.
#
-# Eric S. Raymond
-# esr@thyrsus.com
+# 1.2: Merges in Roger Pilkey's fix for the case in which date spans
+# cross the millenium boundary. Use GNU tac instead of tail, which can't
+# reverse large files properly.
+#
+# Eric S. Raymond <esr@thyrsus.com>
#
# $Id$
# work on each rev of that file in ascending order
set firsttime = 1
- foreach rev (`prs SCCS/s.$file | grep "^D " | awk '{print $2}' | tail -r`)
+ foreach rev (`prs SCCS/s.$file | grep "^D " | awk '{print $2}' | tac`)
if ($status != 0) goto ERROR
# get file into current dir and get stats
set date = (`prs -d":Dd: :Dm: :Dy: :T: :P:" -r$rev SCCS/s.$file`)
set day = $date[1]
set month = $date[2]
- set year = ${century}${date[3]}
+ if ($date[3] < 10) then
+ set next_century = (`expr $century + 1`)
+ set year = ${next_century}${date[3]}
+ else
+ set year = ${century}${date[3]}
+ endif
set time = $date[4]
set author = $date[5]
set date = "$day $months[$month] $year $time"