Everything In Between

The brutally honest, first-person account of Meitar Moscovitz’s life.

Quick ‘N’ Dirty Drupal Module SVN Tagging Script

with one comment

In a (rather beastly) project at work today, I found myself needing to import a significant number of contributed Drupal modules into Subversion vendor branches to prepare for custom development. To do so manually would have been quite the hassle, so after downloading the appropriate tarballs and creating a module_name/current directory under my vendor/drupal/modules vendor branch directory, I concocted this little (relatively untested) script to handle the mass tagging operations I needed to perform.

for i in *; do
    v=`grep 'version = "' "$i/current/$i/"*.info |
      cut -d ':' -f 2 |
        sed -e 's/^version = "/v/' -e 's/"$//'`
    svn cp "$i/current" "$i/$v"
done;

It’s a bit buggy for some modules that have multiple .info files, but I’m sure a few more pipeline stages can fix that. (Which, because I’m done with this at the moment, I will leave as an exercise to the reader.)

Chalk this one up as another testament to the power of shell scripting and how it can help every developer get their job done faster.

Written by Meitar

May 14th, 2008 at 4:46 am

One Response to 'Quick ‘N’ Dirty Drupal Module SVN Tagging Script'

Subscribe to comments with RSS or TrackBack to 'Quick ‘N’ Dirty Drupal Module SVN Tagging Script'.

  1. It is a good idea

    JamesBondd

    16 Sep 08 at 7:16 AM

Leave a Reply