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"
exit
fi;
FILEVAR=`echo "$1" | awk -F"/" '{print $NF}'`
echo $FILEVAR
mkdir $FILEVAR
cd $FILEVAR
pwd
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.
| Attachment | Size |
|---|---|
| gethead.sh_.txt | 320 bytes |
- tags:
































Comments
Post new comment