Automated CVS checkouts of Drupal Core + Contrib
If you've built out more than a few Drupal projects, you've probably gone through the same song & dance a number of times - find the most recent release of core, download, find the most recent release of Views, download, find the most recent release of CCK...
Around here, we've been doing CVS checkouts to simplify upgrades but, even if you have scripts like
#!/bin/bash cvs -z6 -d:pserver:anonymous:email@example.com:/cvs/drupal checkout -r DRUPAL-$1 -d $2 drupal
...there's still the process of going and tracking down the relevant CVS tags which is fairly time consuming. This got me thinking - if the Update module can go out and find what the newest version of a module, why can't I?
It turns out I can.
The Update module gets XML info on the modules from updates.drupal.org - once I parse the feed & figure out what the latest stable release (PHP's built-in version_compare tells you that 5.1.beta4 is newer than 5.0.99) it's pretty simple to actually go do the checkouts. Which is exactly what I've done.
Attached, you should find a copy of the script. Keep in mind this is a development tool & not really fit for "production" or "seeing the light of day" - there's not a whole lot of error checking. I can't guarantee that it'll run anywhere other than on my development machine. IOW - this code is provided as-is.