home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 1 / 1201 < prev    next >
Encoding:
Internet Message Format  |  1990-12-28  |  2.4 KB

  1. From: aap@praxis.co.uk (Andy Pryor)
  2. Newsgroups: alt.sources
  3. Subject: Re: Converting sccs to rcs
  4. Message-ID: <5033@newton.praxis.co.uk>
  5. Date: 18 Apr 90 08:12:12 GMT
  6.  
  7. ron@rdk386.uucp (Ron Kuris) writes:
  8.  
  9.  
  10. >Here is a bourne/korn shell function to convert sccs files to rcs
  11. >files.  I've tried it on quite a few and it seems to work well.
  12.  
  13. >This puppy converts the comments and maintains the version numbers
  14. >too!  Just pass it all the s.* files and it produces ,v files for
  15. >you.  If you create an RCS directory, the files will be placed there.
  16. >Otherwise, they'll be in your current directory.
  17.  
  18. >Also note you'll get an error during the initial 'co' of the file
  19. >that hasn't been started yet.  This is normal and can be ignored.
  20. >(actually, somebody fix it and keep it fast, please).
  21.  
  22. Inspired by the above posting, I've enhanced it to fix the initial 'co' error
  23. and to preserve the timestamp and username associated with each delta.  The
  24. previous posting did not handle branch deltas - I've also fixed this.
  25.  
  26. BTW It's now a perl script (and its not been exhaustively tested!)
  27.  
  28. #!/usr/local/bin/perl
  29.  
  30. foreach $sccsfile ( @ARGV )
  31. {
  32.   ($rcswfile = $sccsfile) =~ s/.*s\.(.*)$/$1/;
  33.   
  34.   foreach $delta ( split(/\n/,`prs -e -d":DS: :I: :D:,:T: :P:" $sccsfile | sort -n`))
  35.   {
  36.     ($seq,$sid,$date,$user) = split(/ /,$delta);
  37.  
  38.     if( $seq != 1 )
  39.     {
  40.       eval `co -l -r$sid $rcswfile\n`;
  41.       eval `rm -f $rcswfile\n`;
  42.     }
  43.  
  44.     eval `get -r$sid $sccsfile\n`;
  45.     ( $sccscomment = `prs -d:C: -r$sid $sccsfile` ) =~ s/\n/ /g;
  46.     eval `ci -r$sid -d$date -w$user -m\"$sccscomment\" $rcswfile\n`;
  47.   }
  48. }
  49.  
  50. .............................................................................
  51. | ARPA   :  aap@praxis.co.uk                     | Andy Pryor               |
  52. | JANET  :  aap@uk.co.praxis                     | PraXis Electronic Design |
  53. | UUCP   :  ...!uunet!mcvax!ukc!praxis!aap       | The New Church           |
  54. |        :                                       | Henry Street             |
  55. |        :                                       | Bath                     |
  56. | Phone  :  +44 225 444700                       | BA1 1JR           UK     |
  57. .............................................................................
  58.  
  59.  
  60. ............................................................................
  61. | ARPA   :  aap@praxis.co.uk                     | Andy Pryor               |
  62. | JANET  :  aap@uk.co.praxis                     | PraXis Electronic Design |
  63.