Working with contrib modules from CVS?

Working with contrib modules from CVS?

by Cormac McClean -
Number of replies: 5
Hi,

I'm working on a brainstorm activity module - version 2 has been added to cvs - and I'm wondering how to work with contrib modules from CVS as part of the Moodle site.

I have downloaded the full Moodle code anonymously:
cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/moodle co -r MOODLE_13_STABLE moodle

which is now at /var/www/moodle.

I then cd to /var/www/moodle/mod and checked out my brainstorm module
cvs -z3 -d:ext:myusername@cvs.sourceforge.net:/cvsroot/moodle co contrib/brainstorm

and so my brainstorm module is now at /var/www/moodle/mod/contrib/brainstorm.

When I go to Moodle's admin page I get the error
"Module 'contrib' is not readable - check permissions"
which is understandable - contrib is not a module.

So, I'm wondering how do I checkout a module from contrib so that it goes into the right place?

Should I now move the brainstorm directory into moodle/mod, and the lang/en/brainstorm.php into lang/en? If I do this, will I be able to commit the changes back to CVS?

Apologies if I'm doing something stupid, it's a while since I used CVS (actually, it was rcs)!

Thanks in advance,
Cormac.
Average of ratings: -
In reply to Cormac McClean

Re: Working with contrib modules from CVS?

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Moving the brainstorm directory by itself into moodle/mod should work.  Be careful updating the whole tree though as it may get rid of the brainstorm folder.

Something I do is to put contrib in a tree parallel to moodle, and create symbolic links to contrib folders from the moodle tree.  I've had troubles installing modules from scratch that way but after that it works fine.
In reply to Martin Dougiamas

Re: Working with contrib modules from CVS?

by Cormac McClean -
Thanks very much for you reply Martin.

I was wondering about using symbolic links, I'll try that.

Regards,
Cormac.
In reply to Martin Dougiamas

Re: Working with contrib modules from CVS?

by W Page -
Thanks for asking that question Cormac.  I have been wondering about it myself.  I usually use SSH to get to the contrib directory and then use FTP to move files/directories around.

  1. What is a "symbolic link"?
  2. How is it helpful
  3. Where can I get some information about it?
WP1
In reply to W Page

Re: Working with contrib modules from CVS?

by Cormac McClean -
Hi WP1,

Symbolic links are a UNIX feature. From about.unix.com (http://http://unix.about.com/library/glossary/bldef-symbolic-link.htm)
---
Definition: A symbolic link is a special kind of file that contains a pathname to another file. The file type entry in the file's inode indicates that it is a symbolic link. When you attempt to access a symbolic link with a text editor or other program, the kernel redirects the program to the file indicated by the symbolic link's pathname. Unlike hard links, symbolic links can be made across different filesystems. Use the ln command with the -s option to create a symbolic link.

After creating a symbolic link from slinkname to oldfilename:

ln -s oldfilename slinkname
---

I think of them as shortcuts. The idea is that you'd be able to checkout the code, make shortcuts to it in the moodle directory, work away on the code in the moodle directory, and the changes are occuring in the checked out code. You'd only have to make the links once, instead of copying across every time.

Unfortunately, I couldn't get them to work for me. What I did was checkout the brainstorm module into /var/www/contrib/brainstorm, and then linked this to /var/www/moodle/mod/brainstorm. However, when I tried it on the browser, I got errors such as (paraphrasing) "file contrib/config.php not found in view.php line 3", i.e. because of the link it's looking for the require() files in the wrong place.

So, for the moment I'm checking out and copying across, until I have time to figure it out. Possibly all that's needed is to use absolute references in the code rather than relative references (using the ..).

Regards,
Cormac.

P.S. Thanks for the positive feedback about the brainstorm module!
In reply to Cormac McClean

Re: Working with contrib modules from CVS?

by W Page -
Thanks Cormac,

I did not realize About.com even had a section on Unix.  I learned something else today. smile

WP1