5 ############################################################
8 if [ ! -d SCCS ] ; then
12 logfile=/tmp/rcs2sccs_$$_log
14 tmpfile=/tmp/rcs2sccs_$$_tmp
16 emptyfile=/tmp/rcs2sccs_$$_empty
17 echo -n "" > $emptyfile
18 initialfile=/tmp/rcs2sccs_$$_init
19 echo "Initial revision" > $initialfile
20 sedfile=/tmp/rcs2sccs_$$_sed
22 revfile=/tmp/rcs2sccs_$$_rev
24 commentfile=/tmp/rcs2sccs_$$_comment
27 # create the sed script
29 s,;Id;,%Z%%M% %I% %E%,g
30 s,;SunId;,%Z%%M% %I% %E%,g
34 s,;Id:.*;,%Z%%M% %I% %E%,g
35 s,;SunId:.*;,%Z%%M% %I% %E%,g
40 sed -e 's/;/\\$/g' $sedfile > $tmpfile
42 ############################################################
43 # Loop over every RCS file in RCS dir
46 # get rid of the ",v" at the end of the name
47 file=`echo $vfile | sed -e 's/,v$//'`
49 # work on each rev of that file in ascending order
51 rlog $file | grep "^revision [0-9][0-9]*\." | awk '{print $2}' | sed -e 's/\./ /g' | sort -n -u +0 +1 +2 +3 +4 +5 +6 +7 +8 | sed -e 's/ /./g' > $revfile
52 for rev in `cat $revfile`; do
57 # get file into current dir and get stats
58 date=`rlog -r$rev $file | grep "^date: " | awk '{print $2; exit}' | sed -e 's/^19//'`
59 time=`rlog -r$rev $file | grep "^date: " | awk '{print $3; exit}' | sed -e 's/;//'`
60 author=`rlog -r$rev $file | grep "^date: " | awk '{print $5; exit}' | sed -e 's/;//'`
63 rlog -r$rev $file | sed -e '/^branches: /d' -e '1,/^date: /d' -e '/^===========/d' -e 's/$/\\/' | awk '{if ((total += length($0) + 1) < 510) print $0}' > $commentfile
64 echo "==> file $file, rev=$rev, date=$date, author=$author"
66 co -r$rev $file >> $logfile 2>&1
71 echo checked out of RCS
73 # add SCCS keywords in place of RCS keywords
74 sed -f $sedfile $file > $tmpfile
79 echo performed keyword substitutions
83 # check file into SCCS
84 if [ "$firsttime" = "1" ]; then
86 echo about to do sccs admin
87 echo sccs admin -n -i$file $file < $commentfile
88 sccs admin -n -i$file $file < $commentfile >> $logfile 2>&1
90 echo ERROR - sccs admin
93 echo initial rev checked into SCCS
97 brev=`echo $rev | sed -e 's/\.[0-9]*$//'`
98 sccs admin -fb $file 2>>$logfile
99 echo sccs get -e -p -r$brev $file
100 sccs get -e -p -r$brev $file >/dev/null 2>>$logfile
103 echo sccs get -e -p $file
104 sccs get -e -p $file >/dev/null 2>> $logfile
108 echo ERROR - sccs get
111 sccs delta $file < $commentfile >> $logfile 2>&1
113 echo ERROR - sccs delta -r$rev $file
116 echo checked into SCCS
118 sed -e "s;^
\ 1d D $rev ../../.. ..:..:.. [^ ][^ ]*;
\ 1d D $rev $date $author;" SCCS/s.$file > $tmpfile
120 cp $tmpfile SCCS/s.$file
121 chmod 444 SCCS/s.$file
124 echo ERROR - sccs admin -z
132 ############################################################
136 rm -f $tmpfile $emptyfile $initialfile $sedfile $commentfile
137 echo ===================================================
138 echo " Conversion Completed Successfully"
139 echo ===================================================