View · Index
No registered users in community rubick
in last 10 minutes

Using CVS with OpenACS

Ignore this page. It's been superceded by:

http://openacs.org/doc/openacs-5-1/cvs-guidelines.html


Working with OpenACS and CVS

by Pascal Scheffers (and Jade Rubick, a little bit)

Introduction

I keep forgetting how to do this stuff. Nuff Said. If you want to know all about CVS, go to the CVSHome.org manual. Oh, by the way: I am not a CVS export. There are absolutely no warranties, like everything else on this site.

Environment

I use OpenACS.org most often, so I have setup my CVSROOT environment variable to reflect that. This makes most cvs commands that much shorter: Edit ~/.bash_profile or ~/.profile and add:
export CVSROOT=:ext:your_user@opeancs.org:/cvsroot
export CVS_RSH=ssh
Next time you login you do not need to specify cvs -d:ext:your_user@openacs.org:/cvsroot, just cvs co something will do.

CVS will now always ask for your password, if you don't want this: start using RSA based authentication with SSH. See the manual page for that (ssh-keygen(1)).

Note: If you have both ssh 1.x and ssh 2.x (>2.3) installed, you may need to specify ssh1 as the OpenACS.org has an older version of SSH installed that doesn't like some newer features. Just try to login ssh2 -l loginname openacs.org. If you get a MAC error or something, try ssh1.

Login

If you are using :pserver:anonymous@... you need to login first:
# cvs login -d:pserver:anonymous@openacs.org/cvsroot
You'll get a password prompt. The password is blank for openacs and sourceforge, so just press enter. You'll only need to do this once.

Fetching packages

To fetch a package:
# cd /web
# cvs -z3 -d:pserver:anonymous@openacs.org:/cvsroot co acs-core
You will end up with /web/openacs-4. The '-z3' sets the compression to level 3, as CVS is mostly sending text, this will speed up things considerably - even on a fast connection.

Fetching a module

You can do this in two or three ways, just use what is most convenient for you:
  • Use the full path:
    # cd /web
    # cvs -z3 -d:pserver:anonymous@openacs.org:/cvsroot co openacs-4/packages/modulename
    
    If you do it like this you need to specify -d:pserver:... or have CVSROOT set.
  • Go to the subdirectory first
    # cd /web/openacs-4/packages
    # cvs -z3 modulename
    
    This works because CVS creates a ./CVS directory in each checked-out directory.

Updating a checked out package

Update resynchronizes your previously checked out tree with the CVS server version. It will merge local changes with remote changes.
So:
# cd /web/openacs-4/packages/modulename
# cvs -z3 update -P -d
'-P' will remove empty directories.
'-d' will make update checkout new directories.

Creating a Patch

If you don't have commit access, you need to create a patch and post it on the bug-tracker on openacs.orgs.

To do a patch on one file, do:

cvs diff filenames -Nu > patchfile
A simple patch command is:
# cd /web
# diff -urb openacs-4/package/foo 4work/package/foo > foo.diff
This will create foo.diff with differences between the CVS version and your fixes. It will NOT add new files to the patch. If you want to add new files, please make sure that there are no 'foo.tcl~' backup files in your new dir. Specify this command to add them:
diff -Nurb openacs-4/package/foo 4work/package/foo > foo.diff

Sharing code with everyone else

The best reference is here Patch submission instructions

If you have a new package you'd like to add to the CVS repository, you do an "import". Note that we have put the new package in the OpenACS contrib directory. In this example, the package name is project-manager.

I wasn't able to get this working quite right. You should be able to do an "import", which will upload all your code so you can share it with everyone else. I couldn't get it to import into the right place -- it kept importing into the /cvsroot directory.

Here's what I did.

First of all, we download a fresh copy of the OpenACS packages and so on. This is the only was I was able to put the package where I wanted it, in the contrib directory. A smarter CVS developer might be able to do this another way.

$ export CVS_RSH=ssh

$ cd /tmp

$ cvs -z3 co openacs-4

$ mv openacs-4/ openacs-head

$ cd openacs-head/contrib/packages/

$ cp -a /path/to/package/project-manager/ .

$ cd project-manager 

$ cvs import -m "Initial import of project-manager" openacs-4/contrib/packages/project-manager jade start
username@openacs.org's password:
N project-manager/filename
...

No conflicts created by this import

In the above example, project-manager is the module name you're adding, jade is what is called the vendor-tag. I used my own name there, but you could use your company name. I'm not totally clear on what start means.

Checking in New files and committing

CVS committers know who they are, only committers can use these commands.
I haven't tried this much yet Suppose you have just copied the sql dirs from oracle to postgresql and want to check them in (to define your directory structure or something, you could also port them first and then add them, of course.)

# cd /web/openacs-4/packages/foo/sql
# mkdir postgresql
# cp oracle/* postgresql 
# cvs add postgresql
# cd postgresql
# cvs add *.sql
# cvs commit -m '(please create a meaningful comment, that always helps)'
Congratulations, you've just made your first public appearance.

Commit

if you have changed files you can cvs commit -m "comments" [file(s)] in the directory you are in. If you do not specify a file cvs will scan the current and all subdirectories for changes and commit them. You can also specify a bunch of files (like '*') or '-l' to prevent it from scanning the subdirectories. It's probably better to commit one file at a time at first, though.

Appendix I - File locations

todo...

Other references