Limiting "lang" files using Putty & TortoiseCVS: The making of a tutorial.

Limiting "lang" files using Putty & TortoiseCVS: The making of a tutorial.

by W Page -
Number of replies: 10

Hello All!

This post is actually a branch from another thread:
Languages broken out into separate CVS module?
http://moodle.org/mod/forum/discuss.php?d=24725

Thank you everyone for trying to help me out with this.  I am still having problems trying to figure out the when and where of the steps you are referring to with both Putty and TortoiseCVS.  If you can help me bit by bit and step by step, I will compile the information and submit it to the DOC Project.  I am sure there are some other folks who need help with this, like I do.

I am going to look for the post in Moodle of the person who helped me originally with configuring Putty.  I think it was Gustav.

Anyway for now I would like to start with Putty and then move on to TortoiseCVS, if it is "OK" with everybody. 

Once I get the following window in Putty, after logging in, what do I type in at the prompt??

WP1

Attachment PuttySignOn.jpg
Average of ratings: -
In reply to W Page

Re: Limiting "lang" files using Putty & TortoiseCVS: The making of a tutorial.

by Samuli Karevaara -
Sorry to ask a silly question, but what are you trying to do with PuTTY and/or TortoiseCVS? (This question is asked in a benevolent way in order to be able to possibly try to answer your question smile )


In reply to W Page

Re: Limiting "lang" files using Putty & TortoiseCVS: The making of a tutorial.

by Jan Dierckx -
Putty is a tool (for windows / other programs exist for other OS) which gives you shell access to a linux server. Once you have shell access (not all providers allow this) you can execute linux commands on your server. And again: providers will limit the commands you are able to use.
When you are permitted to execute the cvs command, you can use it to automatically update your Moodle installation. I think it is best to split the documentation in steps:
  1. How to use cvs for the first time to upload a brand new copy of Moodle. Instructions about this step can be found here. This step should be done only once. Don't try to do run this first CVS command over an existing moodle installation: start fresh with a new directory.
  2. How to update your CVS installation. Use the cd command to move into the root of your Moodle installation. You can use ls to take a look at the content of this directory. You should see all of Moodle's subdirectories. Now type cvs update -dP and all of the files will be updated. More about this step is already here
  3. How to update only parts of your CVS installation. Now that you know how to update the complete Moodle, it is time to learn how you can tell cvs to only update some directories. Issue the following command. Only those directories listed will be updated. That way you can skipp all of the language files.
    cvs update admin auth backup blocks calendar config-dist.php \
    course doc enrol error file.php files filter help.php \
    index.php install.php lib login mod pix rss theme user \
    userpix version.php

You can use the same command to update only the languages you care about:
cvs update lang/en lang/nl


Next step to be written should be:
How to put all of the commands from step 3 in one shell script. Martin L has already provided the script. I haven't yet tested it. I will do that when I start using 1.5 as that seems like a good reason to test such a script.

TortoiseCVS is a nice GUI which makes it easier to use cvs on a windows pc. (Other GUI versions exist for cvs on Mac and Linux) Unfortunately you can't use tortoiseCVS running on your computer to update a copy of Moodle running on a webserver. That's why learning to use the commandline cvs (through Putty) is still necessary. The title of this discussion might confuse people: Limiting "lang" files using Putty & TortoiseCVS should be understood as:
Limiting "lang" files on a linux server using (cvs and) Putty    OR
Limiting "lang" files using TortoiseCVS
In reply to Jan Dierckx

Re: Limiting "lang" files using Putty & TortoiseCVS: The making of a tutorial.

by W Page -

Hi Jan!

Thank you so much for your help with this.

I utilized the code as you indicated and it worked extremely well.  Now I have a better understanding about what is going on with SSH.  The update was so fast, I just could not believe it.  Way cool!!! I utilized the following code to upgrade the languages I use and it worked just fine:
cvs update lang/en lang/en_us lang/es lang/es_ar lang/es_es lang/es_mx

One of the problems with "newbies", like myself, using SSH is we really are unsure of what we are doing and do not want to mess things up.  I am going to go ahead and try to write up a newbie Putty/SSH document/manual for Moodle.  It will include step by step images and detail instructions (probably too detailed for the wise and experienced. big grin).  Hopefully it will make us newbies a bit more brave at using SSH and allow us to get easier and faster control of our Moodles. smile  I will definately give kudos to those who have and will be helpful in getting this together.

Martin D gives some good instructions on using TotoiseCVS but it is unclear even from the thread I referred to in my initial post where to place the script to selectively download sections of Moodle.  If anyone can help with that it would be appreciated.

BTW, it was a post from Paul Norrod that helped me get started with Putty.
http://moodle.org/mod/forum/discuss.php?d=4578&parent=20714

I will put a hold on TotoiseCVS until I get Putty/SSH under better control and better documented.

WP1

In reply to W Page

Re: Limiting "lang" files using Putty & TortoiseCVS: The making of a tutorial.

by Jan Dierckx -
Martin L's  script is NOT for TortoiseCVS. In fact, like Martin L already wrote, scripting is not necessary if you are using TortoiseCVS. TortoiseCVS is a GUI: you can do everything (well, er ... most of things) by clicking the mouse. Just click on the directories you want updated (everything but the lang directory) and then select update from the context menu. It's easier using TortoiseCVS, but you can only use TortoiseCVS to update a local copy of Moodle on a Windows computer. You can NOT use it to update a Moodle installation that is on the server.

But I think you are right: using the cvs command gives you a better feel for what is happening when you start using TortoiseCVS. After all, behind every TortoiseCVS menu option is just a separate cvs command.


In reply to Jan Dierckx

Re: Limiting "lang" files using Putty & TortoiseCVS: The making of a tutorial.

by W Page -

Hi Jan!

Thanks again for the clarification. 

Just to show how "backward" I am with all of this, I did not realize that Martin L meant choosing the directories on the computer that I wanted to update.  I though he meant choosing the directories through the TotoiseCVS GUI to do this and I could not figure out what window in the TotoiseCVS application to use.

WP1

In reply to W Page

Re: Limiting "lang" files using Putty & TortoiseCVS: The making of a tutorial.

by Just H -
Hi there W Page

Was wondering if you had completed your guide . . . coz I definitely need one! big grin
In reply to Jan Dierckx

Re: Limiting "lang" files using Putty & TortoiseCVS: The making of a tutorial.

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Using Windows Explorer, if you want to update a whole Moodle directory except languages, you must select all subdirectories and files in your \moodle directory, then unselect:
the \lang sub-directory
the \Cvs directory (which will only be visible if you chose to have hidden files & directories displayed in your Windows file manager settings, of course)
the config.php file, which you will have modified according to your installation settings...
Actually it's easy because those files/directories which can be cvs updated are displayed with a little green tick attached to them.
Joseph
In reply to W Page

Re: Limiting "lang" files using Putty & TortoiseCVS: The making of a tutorial.

by Just H -
Hi all

Can anyone point me in the right direction to an idiots guide on how to combine various CVS commands into one so that I only update what I want to (deleted language files twice now as I keep reloading them when I update!)

Thanks
H
In reply to Just H

Re: Limiting "lang" files using Putty & TortoiseCVS: The making of a tutorial.

by Martín Langhoff -

Harry,

assuming you are using the command line cvs utility, once you have the moodle checkout, just issue

    cvs update admin auth backup blocks calendar config-dist.php \
    course doc enrol error file.php files filter help.php \
    index.php install.php lib login mod pix rss theme user \
    userpix version.php

that's all the "command" you need. Of course, you can create a little moodleupdate.sh shell script, containing

    #!/bin/bash 
    cvs update admin auth backup blocks calendar config-dist.php \
    course doc enrol error file.php files filter help.php \
    index.php install.php lib login mod pix rss theme user \
    userpix version.php

Make it executable (chmod ugo+x) and then you just type moodleupdate.sh). On Windows, the equivalent thing is to create moodleupdate.bat, containing just

    cvs update admin auth backup blocks calendar config-dist.php \
    course doc enrol error file.php files filter help.php \
    index.php install.php lib login mod pix rss theme user \
    userpix version.php

If you are using TortoiseCVS, here's the trick you need: http://moodle.org/mod/forum/discuss.php?d=24725#117300

In reply to Martín Langhoff

Re: Limiting "lang" files using Putty & TortoiseCVS: The making of a tutorial.

by Just H -
Thanks Martin

I'm actually using PuTTY, this command line stuff is kind of scary when you first start with it ! Most of the stuff I've tracked down via google isn't exactly written for us "command line challenged" people mixed

But, that makes a lot of sense, basically by doing a "cvs update -dP" I've been telling it to do the whole thing by default but if I actually nominate (as you have written) the directories/files I want to update it will leave the rest alone.

Thanks again, it's definitely the help offered by the community that makes Moodle stand out above the rest more than anything (apart from being amazing software of course!).

regards
H