Vendor Branches for Modules

Use Subversions "vendor branch" capabilities for managing Drupal module installation and updating.

Ross Burton's Vendor Branches in Subversion is a decent explanation of how vendor branching works.
CodeGobbler has an article on SVN repository structure for Drupal projects that includes using svn:externals for modules.

Adding a module to your local Drupal repo
Check out a copy of the module section of your local Drupal SVN repo:

cd /tmp
svn checkout file:///var/svn/drupal/modules modules

Within the checked-out copy, create folders for a modules. We'll use the Update Status module as an example:

cd modules
svn mkdir update_status
svn mkdir update_status/current

Commit your changes back to the repository:

cd /tmp/modules
svn commit -m "Added update_status module structure."

The checked-out copy of the modules folder can be deleted at this point:

cd /tmp
rm -rf modules

Now download and untar a release of the module:

cd /tmp
wget http://ftp.drupal.org/files/projects/update_status-5.x-2.2.tar.gz
tar zxf update_status-5.x-2.2.tar.gz
rm -f update_status-5.x-2.2.tar.gz

Normally, when you untar a Drupal module, the resulting directory name doesn't contain the version number. However, in our case we're going to want it to contain that detail:

mv update_status update_status-5.x-2.2

We'll use the svn_load_dirs.pl script to load the module into current:

svn_load_dirs.pl file:///var/svn/drupal/modules/update_status current update_status-5.x-2.2 -t update_status-5.x-2.2

Install the module to your site
Navigate to where you want to add the module (sites/all/modules or sites/sitename/modules). If the folder doesn't exist, create it. Eg:

cd /var/websites/projectname/htdocs/sites/all
svn mkdir modules

Copy the module to the checked out site:

cd modules
svn export http://<your_svn_server>/svn/drupal/modules/update_status/current update_status
svn add update_status

Upgrading the current module in your Drupal repo
Download the new module version:

cd /tmp
wget http://ftp.drupal.org/files/projects/cck-5.x-1.9.tar.gz
tar zxf cck-5.x-1.9.tar.gz
mv cck cck-5.x-1.9
rm -f cck-5.x-1.9.tar.gz

Load the new version into current:

svn_load_dirs.pl file:///var/svn/projectname/vendor/modules/cck current \
/tmp/cck-5.x-1.9 -t cck-5.x-1.9

Recent Updates

  • 1 year 12 months ago
  • 1 year 12 months ago
  • 1 year 12 months ago
    php 8.x
  • 1 year 12 months ago
    10.6.7
  • 2 years 1 day ago
    Drop Centos 5/6 stuff