From fa1f8814f368b105c926a749eb18aa737e41fbeb Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Thu, 10 Apr 2003 02:18:52 +0000 Subject: [PATCH] Roger Pilkey's fix. --- sccs2rcs | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/sccs2rcs b/sccs2rcs index bcdef53..d1c4fa1 100755 --- a/sccs2rcs +++ b/sccs2rcs @@ -42,12 +42,15 @@ # 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 # # $Id$ @@ -202,14 +205,19 @@ foreach sfile (SCCS/s.*) # 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" -- 2.43.0