Easy drupal core hacking

I have found myself attempting to contribute to Drupal core more and more lately. So I wrote a shell script that gets me a fresh copy of head and applies a patch to it.

Essentially I will be looking through a Drupal issue, such as http://drupal.org/node/229778 and I'll want to add to a patch on there. I simply grab the URL of the patch file and run my gethead.sh

./gethead.sh http://drupal.org/files/issues/229778-log-changes-to-offline-mode.patch

This will create a directory based on the filename of the patch, check out head into that directory. Fetch the patch and apply it.

if [ "$1" = "" ]; then
echo "I need a \$1 URL to a patch file"
FILEVAR=`echo "$1" | awk -F"/" '{print $NF}'`
mkdir $FILEVAR
cvs -z6 -d :pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal checkout drupal
wget $1 --output-document=$FILEVAR
cd drupal
patch -p0 <../$FILEVAR

p.s. If I was to extend this, which I may, I would create a db and fix the settings file straight away to point at it. I'd probably use mysqlhotcopy.

gethead.sh_.txt320 bytes


Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

By submitting this form, you accept the Mollom privacy policy.