I'm successfully updating my Moodle 1.8+ and Moodle 1.9+ installs via CVS.
I can also update my contrib folder (that lies at the same level as my moodle18 and moodle19 folders) in htdocs.
I'm using a handful of 3rd party modules and plugins in my moodle18 and moodle19 folders.
My question:
Is there a way, through CVS, to automatically update those within those 3rd party mod and blocks folders without having to update the contrib folder and then manually moving them to their respective locations within the moodle18 and moodle19 folders?
I am using the original and self-modded scripts (originally from Ralf Krause) within MAMP to do the three aforementioned tasks with single mouse-clicks.
I'm thinking I might be able to slide a line of code in the moodle18 and moodle19 CVS update scripts that would check specific 3rd-party mods and plugins .... and update them within the those folders themselves.
If you think its possible, what might the line of code look like?
Below are the scripts I currently use for updating moodle19 and the contrib folders.
======================
# 20071010 - Ralf Krause
#
export CVS_RSH=ssh
echo
echo "+--------------------------------------------+"
echo "| CVS update for your local Moodle4Mac "
echo "+--------------------------------------------+"
echo
cd /Applications/MAMP/htdocs/moodle19/
### delete all files named .DS_Store
find . -name ".DS_Store" -type f -print0 | xargs -0 rm -f
### file ~/.cvspass must exist
if ! test -e ~/.cvspass ; then
touch ~/.cvspass
fi
### login to the cvs server only for the first time
if ! grep "uk.cvs.moodle.org" ~/.cvspass > /dev/null ; then
echo "CVS password is empty ... please only press <return> to start"
cvs -d :pserver:anonymous@uk.cvs.moodle.org:/cvsroot/moodle login
echo
fi
echo "Connecting to the CVS server. Download will take a few moments!"
echo "If the CVS update runs too long you may break with <strg>-C"
echo
cvs -q update -dP -r MOODLE_19_STABLE
======================
# 20071010 - Ralf Krause
# 20080303 - Modded by Larry Elchuck
export CVS_RSH=ssh
echo
echo "+--------------------------------------------+"
echo "| CVS update for your my CONTRIB folder "
echo "+--------------------------------------------+"
echo
cd /Applications/MAMP/htdocs/
### delete all files named .DS_Store
find . -name ".DS_Store" -type f -print0 | xargs -0 rm -f
### file ~/.cvspass must exist
if ! test -e ~/.cvspass ; then
touch ~/.cvspass
fi
### login to the cvs server only for the first time
if ! grep "uk.cvs.moodle.org" ~/.cvspass > /dev/null ; then
echo "CVS password is empty ... please only press <return> to start"
cvs -d :pserver:anonymous@us.cvs.moodle.org:/cvsroot/contrib login
echo
fi
echo "Connecting to the CVS server. Download will take a few moments!"
echo "If the CVS update runs too long you may break with <strg>-C"
echo
cvs -q -z3 -d:pserver:anonymous@uk.cvs.moodle.org:/cvsroot/moodle co contrib
========================
thanks
larry
CVS Updating of 3rd-Party Plug-ins in the Moodle folder itself
by Larry Elchuck -
Number of replies: 10
In reply to Larry Elchuck
Re: CVS Updating of 3rd-Party Plug-ins in the Moodle folder itself
by sam marshall -
It's probably possible - but why not keep just separate moodle and contrib folder trees? Inside your moodle one, add a symlink (or hardlink*) to the relevant folder within contrib.
--sam
* Hard links work regardless of webserver config and can be done on all recent Windows platforms (look for 'junction'), which is not always true of symlinks. However they're a bit sketchy.
--sam
* Hard links work regardless of webserver config and can be done on all recent Windows platforms (look for 'junction'), which is not always true of symlinks. However they're a bit sketchy.
In reply to sam marshall
Re: CVS Updating of 3rd-Party Plug-ins in the Moodle folder itself
by Larry Elchuck -
Thanks Sam
I will explore this approach, but would still like to know if the other solution is possible and what it might look like. So others, please post the other method, if indeed there is one.
Is this how it would work for the placement of the feedback module in a htdocs/moodle19 folder (assuming moodle19 and contrib are at the same level), for example, Sam?
1. cd to moodle19/mod, then enter
2. ln -s ../../contrib/plugins/mod/feedback feedback
larry
I will explore this approach, but would still like to know if the other solution is possible and what it might look like. So others, please post the other method, if indeed there is one.
Is this how it would work for the placement of the feedback module in a htdocs/moodle19 folder (assuming moodle19 and contrib are at the same level), for example, Sam?
1. cd to moodle19/mod, then enter
2. ln -s ../../contrib/plugins/mod/feedback feedback
- Will this allow access to the entire folder contents?
- Will this relative linking work if I move the moodle19 and contrib folders from one Mac OS X box to another, or to a linux box?
- Anything else I should know?
larry
In reply to Larry Elchuck
Re: CVS Updating of 3rd-Party Plug-ins in the Moodle folder itself
by Tim Hunt -
What you are asking for is possible, in fact even easy, thanks to a quirk of how CVS works.
You will notice in your CVS checkout that there are folders called CVS inside every other folder. One of the files in the CVS sub-folder tells CVS where this stuff came from originally.
So if you copy folders of code, including the CVS subfolders from your contrib checkout to your moodle checkout, then when you cvs update your main Moodle, all the subfolders will get updated too.
However, this probably works best if you don't specify any tag names on the cvs update command - that is not necessary anyway, because which branch you originally checked out is part of the metadata in the CVS subfolders.
However, before relying on any of this in production, I would strongly advise you to try all this out in an experimental area.
You will notice in your CVS checkout that there are folders called CVS inside every other folder. One of the files in the CVS sub-folder tells CVS where this stuff came from originally.
So if you copy folders of code, including the CVS subfolders from your contrib checkout to your moodle checkout, then when you cvs update your main Moodle, all the subfolders will get updated too.
However, this probably works best if you don't specify any tag names on the cvs update command - that is not necessary anyway, because which branch you originally checked out is part of the metadata in the CVS subfolders.
However, before relying on any of this in production, I would strongly advise you to try all this out in an experimental area.
In reply to Tim Hunt
Re: CVS Updating of 3rd-Party Plug-ins in the Moodle folder itself
by Larry Elchuck -
Thanks Tim
When I try this, should I change cvs -q update -dP -r MOODLE_19_STABLE to cvs -q update -dP -r ?
larry
When I try this, should I change cvs -q update -dP -r MOODLE_19_STABLE to cvs -q update -dP -r ?
larry
In reply to Tim Hunt
Re: CVS Updating of 3rd-Party Plug-ins in the Moodle folder itself
by Larry Elchuck -
Hi Tim
I changed it to cvs -q update -dP and added the flash module from a recently CVS updated contrib folder on my server. The update for the moodle folder proceeded as desired but I don't think the 3rd party mods are being updated.
The flash module was not there before. It still showed up as
? mod/flash, so I assume it is not recognizing it from the CVS.
I removed a text file from it, to see if it would update it ... but no go.
All of the 3rd party mods that I'm using also show up with a ? prefix.
thanks
larry
I changed it to cvs -q update -dP and added the flash module from a recently CVS updated contrib folder on my server. The update for the moodle folder proceeded as desired but I don't think the 3rd party mods are being updated.
The flash module was not there before. It still showed up as
? mod/flash, so I assume it is not recognizing it from the CVS.
I removed a text file from it, to see if it would update it ... but no go.
All of the 3rd party mods that I'm using also show up with a ? prefix.
thanks
larry
In reply to Larry Elchuck
Re: CVS Updating of 3rd-Party Plug-ins in the Moodle folder itself
by Tim Hunt -
I'm sorry, I don't often do this myself, and when I do, I tend to use a GUI client (Eclipse) rather than the command line, so you are really asking the wrong person. I just know it is possible in principle.
The ideal thing would be for the right process to be described in detail on http://docs.moodle.org/en/CVS_for_Administrators. I don't suppose you have got time to draft something based on what you have learned so far. If you do that, then you have the moral high ground to pressurise Martin, or some other expert, to correct the errors and complete it
Actually, in the best traditions of open source, you may be able to steal from another project. I have this vague memory of some Drupal documentation about this. It may even be http://drupal.org/node/321.
The ideal thing would be for the right process to be described in detail on http://docs.moodle.org/en/CVS_for_Administrators. I don't suppose you have got time to draft something based on what you have learned so far. If you do that, then you have the moral high ground to pressurise Martin, or some other expert, to correct the errors and complete it
Actually, in the best traditions of open source, you may be able to steal from another project. I have this vague memory of some Drupal documentation about this. It may even be http://drupal.org/node/321.
In reply to Tim Hunt
Re: CVS Updating of 3rd-Party Plug-ins in the Moodle folder itself
by Martín Langhoff -
Tim's 100% right about the quirk of CVS and I am sure the commandline clients will work perfectly well. Some below-average-quality GUI clients might break with this setup.
One thing to note is that under the new contrib setup, the contrib modules _do_ have a _STABLE branch for recent releases. So passing -rMOODLE_19_STABLE is be the right thing to do. This is the plan as far as I understand, not sure if it is in use for all contrib modules. Perhaps Anthony can say something authoritative... (typoed: anthonitative )
One thing to note is that under the new contrib setup, the contrib modules _do_ have a _STABLE branch for recent releases. So passing -rMOODLE_19_STABLE is be the right thing to do. This is the plan as far as I understand, not sure if it is in use for all contrib modules. Perhaps Anthony can say something authoritative... (typoed: anthonitative )
In reply to Martín Langhoff
Re: CVS Updating of 3rd-Party Plug-ins in the Moodle folder itself
by Anthony Borrow -
Martín - Ultimately it is up to the maintainer of the contributed (i.e. 3rd party) code to determine for which version(s) of Moodle the contributed code is directed and intended to work with. For each major release (i.e. 1.6, 1.7, 1.8, and the wonderful 1.9) they maintainer can request that we create a separate branch for. That way they can maintain plugins specifically maintained for particular versions. They also have a HEAD version with is useful for having a development version. Peace - Anthony
In reply to Tim Hunt
Re: CVS Updating of 3rd-Party Plug-ins in the Moodle folder itself
by Martin Dougiamas -
Tim is correct here. I do this on my sites, including moodle.org itself.
In reply to Tim Hunt
Re: CVS Updating of 3rd-Party Plug-ins in the Moodle folder itself
by Larry Elchuck -
Here's what works for me, as an addenda to the code in red above:
echo
echo "+--------------------------------------------+"
echo "| CVS update for your installed 3rd party modules "
echo "+--------------------------------------------+"
echo
cd /Applications/MAMP/htdocs/moodle19/mod
cvs -q -z3 -d:pserver:anonymous@uk.cvs.moodle.org:/cvsroot/moodle co -d feedback contrib/plugins/mod/feedback
echo
echo "+--------------------------------------------+"
echo "| CVS update for your installed 3rd party blocks "
echo "+--------------------------------------------+"
echo
cd /Applications/MAMP/htdocs/moodle19/blocks
cvs -q -z3 -d:pserver:anonymous@uk.cvs.moodle.org:/cvsroot/moodle co -d course_menu contrib/plugins/blocks/course_menu
The cvs -q line for each module and block would need to be repeated for each embedded 3rd party module and block.
The path to the htdocs/moodle folder would need be correct for each cd command.
larry
echo
echo "+--------------------------------------------+"
echo "| CVS update for your installed 3rd party modules "
echo "+--------------------------------------------+"
echo
cd /Applications/MAMP/htdocs/moodle19/mod
cvs -q -z3 -d:pserver:anonymous@uk.cvs.moodle.org:/cvsroot/moodle co -d feedback contrib/plugins/mod/feedback
echo
echo "+--------------------------------------------+"
echo "| CVS update for your installed 3rd party blocks "
echo "+--------------------------------------------+"
echo
cd /Applications/MAMP/htdocs/moodle19/blocks
cvs -q -z3 -d:pserver:anonymous@uk.cvs.moodle.org:/cvsroot/moodle co -d course_menu contrib/plugins/blocks/course_menu
The cvs -q line for each module and block would need to be repeated for each embedded 3rd party module and block.
The path to the htdocs/moodle folder would need be correct for each cd command.
larry