CVS in Cygwin
From WebCalendar Wiki
This is a step by step guide to using the CVS module in Cygwin on a Windows XP system. At least, as far as I understand it.
- Download and install the Cygwin setup program from [Cygwin]. It's down the page a bit, under 'What's New and How Do I Get it?'. The link called 'setup.exe'. setup.exe, at less than 300K, is NOT the main program. It just lets you configure what options you want to download and install later.
- After you have setup.exe downloaded, double click it to start. Read the screens that come up carefully. Select, or type in, the options you want. Click 'Next' to continue.
- About 6 screens in, you'll come to a page called, 'Choose a Download Site'.
- The next relevant screen is, 'Select Packages'. There are dozens and dozens of options. I strongly suggest leaving 'default' for most items here. On dial-up, even that is going to take awhile. If you select 'ALL', it's going to take about 30+ gigs of disk space! That said, you do have to go through and find the module 'cvs: Concurrent Version System', and any other things you want to play with. Each site seems to be set up just a little differently, so, it may take a few minutes to find. Start looking in the 'devel' or 'utils' links. Try not to get too side-tracked with all the other 'neat stuff'. I lost about 4 hours that way. :-/
- When you click 'Next' after selecting your packages, take a few minutes to make sure it's working, then go have a nice romantic dinner with your S.O. Even with DSL, this is going to take a couple of hours. The defaults and the CVS module are only about 242 megs but, it does a lot of initializing, too. If it craps out, run setup.exe again from the same download site. It should pick up where it left off.
- When you get a good install, (took me about 5 times but, those were my mistakes, not Cygwins'), double click the Cygwin icon. The first time, it will do some setting up stuff, copy some files around and such. Then you'll get a command prompt. (What do you mean, "What's a command prompt?" Geez. GUI spoiled youngsters. :-) A command prompt is basically a blank screen with your name@username, a dollar sign, and a blinking cursor. You actually have to type in commands here.)
- The first thing you'll want to do, every time you start Cygwin, is tell it where you want to be in the directory structure. (There is an option to name a default folder but, I haven't played with it, yet.) I personally use 'cd p:/ but, yours will most likely be different. 'cd' means 'change to directory'. The 'p:/' is the drive / path.
- Now the fun stuff really begins. To get the latest, most up to date, bleeding edge, copy of Webcalendar, you need to do this one time. At the command prompt, type in: (Cygwin will wrap it at column 80. But, you need to start at the 'cvs ' and keep going 'all on one line'. Where the wiki breaks the line here, put in a space. Press RETURN at the end. Sorry, no, you can't copy it from here and paste into Cygwin. :-()
cvs -z3 -d:pserver:anonymous@webcalendar.cvs.sourceforge.net:/cvsroot/webcalendar co -P webcalendar
- This will create a sub-folder called 'webcalendar' in the directory where you ran the command. All of the program files will be downloaded there, each in it's own proper sub-sub-folder.
- Type "exit" to close Cygwin.
- Using your editor-of-choice, make any changes, updates, patches, etc. you want to these pristine new program files. Have fun!
- Periodically, you'll want to get all the changes that the developers have made, and merge them with yours. To do that, start Cygwin, tell it where you want to be. Your command prompt should look something like, 'name@username "p:/webcalendar"'. Make sure 'webcalendar' is the last bit. Then type in,
cvs update -dP
- All the changes that Craig, Ray, Adam, and the other real developers have made will now be part of your copy. Cool, huh? However, this will NOT send them all the neat stuff you've done with WebCalendar. For that you'll need
- From Cygwin, and the webcalendar directory, type something along these lines,
cvs diff -u ChangeLog > changelog.patch
- This will create a file, changelog.patch, listing all the differences between the Changelog file on your system and the CVS version. Substitute the file name with your modifications in place of ChangeLog above to diff that file. Then you'll need to post your new xyz.patch file to the Webcalendar patches forum. If the-powers-that-be like it, think it's useful, or have received your very large bribe, it may get included in the next version of Webcalendar.
Now. go forth and modify!
[edit] Creating a Patch File with Cygwin diff
If you get errors trying use a patch file created from Cygwin, it may be an issue with the text formant (DOS/Mac/Unix). You can do the following to pull out all the DOS carriage returns:
diff -crw WebCalendar.orig WebCalendar.modified | tr -d '\015' > mods.patch
And, of course, WebCalendar.orig is the unmodified version of the WebCalendar files, and WebCalendar.modified is the version that you modified.
