#!/bin/sh # Usage: scriptname m|t projectname DRUPAL-6--2 # License: GPL modules_dir='modules/' themes_dir='themes/' default_revision='DRUPAL-6--1' function getfromcvs() { case $type in m) cvs -z6 -d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal-contrib checkout -d $modules_dir$2 -r $3 contributions/modules/$2 ;; t) cvs -z6 -d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal-contrib checkout -d $themes_dir$2 -r $3 contributions/themes/$2 ;; esac } if [ $# -lt 1 ] then clear echo 'Choose from cvs.drupal.org to download module or theme?' echo '' echo ' m) module' echo ' t) theme' echo '' printf 'Please enter a letter (m or t): ' read type else type=$1 fi if [ $# -lt 2 ] then echo case $type in m) printf 'Type the name of the module: ';; t) printf 'Type the name of the theme: ';; esac read project else project=$2 fi if [ $# -lt 3 ] then echo printf "Press Enter to use default $default_revision, or specify revision: " read revision if [ -s $revision ] then revision=$default_revision fi else revision=$3 fi echo case $type in m) printf "Press Enter to use default directory; $modules_dir, or specify path to the modules directory (with / at the end): " read new_modules_dir if [ ! -s $new_modules_dir ] then modules_dir=$new_modules_dir fi ;; t) printf "Press Enter to use default directory; $themes_dir, or specify path to the themes directory (with / at the end): " read new_themes_dir if [ ! -s $new_themes_dir ] then themes_dir=$new_themes_dir fi ;; esac getfromcvs $type $project $revision