Checking out from the main repository
Accessing the files using the web interface
There are two ways to access the latest Drupal sources in the main CVS repository. For a quick look at some core or contrib files, use the ViewCVS web interface. To get a local copy of the complete source tree to study and work with the code checkout a full version of the codebase with a CVS application.
Make sure you have the latest version of CVS app
Linux users should have a CVS program already installed by default. If you don't, install a recent copy of CVS. You may wish to use your package management tools (apt-get, yum, etc.)
FreeBSD includes CVS in the base system in all versions.
Mac users need to get the latest version of Xcode Tools from the Apple Developer's website, or check out the Concurrent Version Librarian: point and click CVS site. There is also a Handbook page with some tutorials on how to use the CVL (GUI) application.
Windows users will need to download a program before trying to use CVS. There are quite a few CVS programs for Windows.
Checking Out Drupal using a bash shell
Note that CVS uses port 2401 any firewalls will need this port open in order to perform these commands.
To check out the latest Drupal source code, commonly called "HEAD", use the command:
$ cvs -z6 -d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal checkout drupalThis will create a directory called
drupal containing the latest drupal source tree (-z6: use gzip compression so the transfer takes less time. -d: specify the 'directory' where the files are located and how to access them). Typical users who want the most recent stable version of Drupal should not check out the HEAD version. For that, see below, "Check out a specific Drupal version." You find out the most current Drupal version by going to the Drupal.org home page.
To check out Drupal to a specific directory, such as mywebsites/drupal_head, you can place a pathname just before the final 'drupal', like so:
$ cvs -z6 -d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal checkout -d mywebsites/drupal_head/ drupalRun this command from the root of your drive! Observe the lack of a leading slash in this pathname, even though you are running it from /. Adding a beginning slash will cause errors in most cases.
It's important to understand that this will create the directories if they do not exist, so if you're not at the root of your drive when you run this one, and you don't see your newly checked out drupal instance, go and look for the site in a path relative to where you are right now. It'll be hiding there.
Other useful methods of performing the checkout are:
- Checkout a specific Drupal version:
$ cvs -z6 -d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal co -r DRUPAL-6-14 drupal
where "6-14" is the name of a particular Drupal release. You find out the name of the most current Drupal version by going to the Drupal.org home page. A complete list of versions is found at:List of core branches and tags. - Checkout Drupal from a specific date:
$ cvs -z6 -d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal co -D "31 Oct 2008" drupal - Using aliases to speed up checkout. If you check out often, consider adding an alias to your bash profile so you don't have to type the entire string each time. (Mac OS 10.3 (Panther) and higher defaults to bash, so treat these instructions as though they're written for Terminal.)
Add the following line(s) to the ".bash_profile" or ".bashrc" file in your home directory.
alias checkouthead='cvs -z6 -d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal checkout drupal'
alias checkout6='cvs -z6 -d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal co -r DRUPAL-6 drupal'
alias checkout6-6='cvs -z6 -d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal co -r DRUPAL-6-6 drupal'
The new alias is now "checkouthead" or "checkout6", or whatever other aliases you'd like to create. Whenever you need a fresh copy of drupal, cd your way into the directory where you keep all your sites, type "checkouthead", then stand back and watch the magic! You'll end up with a folder called "drupal" which you can then rename to "drupalHEAD" or "d6" or whatever you want it to be. - Exporting Drupal without CVS folders:
When you do a 'checkout' it checks out all files along with CVS files and folders, which enables you to do a 'cvs update' later. Sometimes, however, you want to take a copy of the code without the CVS files, for example to import into your own CVS repository. This can be done with the 'export' command.
An example of exporting the latest development snapshot of Drupal:
cvs -z6 -d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal export -r HEAD drupalHere is an example of exporting a specific version of Drupal. In this example the "6" represents the major release and the "6" represents the security/bug release number:
cvs -z6 -d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal export -r DRUPAL-6-6 drupalThat will give you a copy of Drupal without any tracking information or extra data to associate it back to CVS. Note that you can, of course, export any branch or date using the above switches.
Keeping your HEAD in the game
Once you have a copy of the Drupal HEAD, keeping up-to-date is simple! Use the cd command to navigate your way into your HEAD directory, and then use:
$ cvs update -dPto update all files to their latest versions. The
-d creates any (new) directories that exist in the repository if they're missing from your local working directory. The -P flag prunes any and all empty directories, i.e. directories that got removed in the repository will also be removed in your working copy too.
To update to a newer version of Drupal, you can use the version tag via the -r flag:
$cvs update -dP -r DRUPAL-6-14You can also use the command:
$ cvs -q update -dPto suppress informational messages related to the update (
-q: quiet).
Special Cases
Using a HTTP Proxy
You can add the proxy information to the checkout command. Note that you need to escape your semicolons with a backslash if you are on a Unix command line: \;.
cvs -z6 -d:pserver;proxy=example.com;proxyport=8080:anonymous:anonymous@cvs.drupal.org:/cvs/drupal checkout drupal Logging in under tcsh
The above commands will not work at all for many users running tcsh with older versions of CVS (the login command with username:password@server doesn't work at all, for example.) Here is the proper method for connecting in such situations:
> setenv CVSROOT ":pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal"
> cvs login
(Logging in to anonymous@cvs.drupal.org)
CVS password:
> cvs co drupal
Drupal CVS Bash Script
You could also create a bash script with an alias to checkout specific versions (such as the most recent version) so you don't have to keep modifying alias information. The bash script would look like this:
cvs -z6 -d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal co -r $1 drupal
Notice the $1. That allows you to throw parameters into the script on the fly.
For example after making the 'drupal' script executable (chmod 700 drupal) you could execute it as:
drupal DRUPAL-6-9
and that would pull down Drupal version 6.9.
Checking out latest of D6
One thing I don't see covered up there is how to check out the very latest dev code of a branch. I had no luck with Google and finally asked on IRC and eaton gave me the answer I needed. This will check out the very latest development version of D6:
cvs -z6 -d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal co -d DIRECTORY_FOR_DRUPAL -r DRUPAL-6 drupal
Change "DIRECTORY_FOR_DRUPAL" to whatever you want the directory to be named.
Michelle
---
Coulee Region Online: Social networking and area information. You're welcome to visit but please don't make an account unless you want to join the community.
Base path to contrib repository
For many gui-tools you need
user name: your_cvs_name or
anonymous
password: your_cvs_password or
anonymous
Servername:
cvs.drupal.org
the base directory of the repository:
for core:
/cvs/drupal
for contrib-modules:
/cvs/drupal-contrib
in the contrib Repository brows to the directory
contributions/modules
to find the modules.
Thomas
Combining IT and arts to organize
http://it-arts.org
It would be amazing if a
It would be amazing if a Windows CVS GUI could do this:
- choose Drupal version, e.g. DRUPAL-6-15
- choose contribs, their versions and folder locations, e.g. ctools DRUPAL-6--3-2 sites/all/modules
- choose themes
- click "BUILD" to put everything together, while having CVS take care of updating/switching both core, contribs and themes
You could update entire projects+contribs under a minute.
Mindblowing this doesnt exist yet. Sadly, I can't code windows apps.
Morningtime Digital Media | Vote for Drupal at CMS Match