[ ! -d "$to" ] && mkdir "$to"
rsync -avC $excludes_rsync --include=core "$repo/./" "$to/./"
}
+
+## Copy Drupal-integration module
+## usage: dm_install_drupal <drupal_repo_path> <to_path>
+function dm_install_drupal() {
+ local repo="$1"
+ local to="$2"
+
+ local excludes_rsync=""
+ for exclude in .git .svn ; do
+ excludes_rsync="--exclude=${exclude} ${excludes_rsync}"
+ done
+
+ [ ! -d "$to" ] && mkdir "$to"
+ rsync -avC $excludes_rsync "$repo/./" "$to/./"
+}
+
+## TODO: Merge this into dm_install_drupal; use on all Drupal releases
+## usage: dm_install_drupal_info <to_path>
+function dm_install_drupal_info() {
+ local to="$1"
+
+ # set full version in .info files
+ local MODULE_DIRS=`find "$to" -type f -name "*.info"`
+ for INFO in $MODULE_DIRS; do
+ if [ $(uname) = "Darwin" ]; then
+ ## BSD sed
+ sed -i '' "s/version = [1-9.]*/version = $DM_VERSION/g" $INFO
+ else
+ ## GNU sed
+ sed -i'' "s/version = [1-9.]*/version = $DM_VERSION/g" $INFO
+ fi
+ done
+}
# copy all the stuff
dm_install_core "$SRC" "$TRG"
dm_install_packages "$SRC/packages" "$TRG/packages"
-for CODE in drupal; do
- echo $CODE
- [ -d $SRC/$CODE ] && $RSYNCCOMMAND $SRC/$CODE $TRG
-done
+dm_install_drupal "$SRC/drupal" "$TRG/drupal"
# copy docs
cp $SRC/drupal/civicrm.config.php.drupal $TRG/civicrm.config.php
# copy all the stuff
dm_install_core "$SRC" "$TRG"
dm_install_packages "$SRC/packages" "$TRG/packages"
-for CODE in drupal; do
- echo $CODE
- [ -d $SRC/$CODE ] && $RSYNCCOMMAND $SRC/$CODE $TRG
-done
+dm_install_drupal "$SRC/drupal" "$TRG/drupal"
+dm_install_drupal_info "$DM_SOURCEDIR/drupal"
cp $SRC/drupal/civicrm.config.php.drupal $TRG/civicrm.config.php
-# set full version in .info files
-MODULE_DIRS=`find "$DM_SOURCEDIR/drupal" -type f -name "*.info"`
-for INFO in $MODULE_DIRS; do
- if [ $(uname) = "Darwin" ]; then
- ## BSD sed
- sed -i '' "s/version = [1-9.]*/version = $DM_VERSION/g" $INFO
- else
- ## GNU sed
- sed -i'' "s/version = [1-9.]*/version = $DM_VERSION/g" $INFO
- fi
-done
-
-
# final touch
echo "<?php
function civicrmVersion( ) {
# gen tarball
cd $TRG/..
+
tar czf $DM_TARGETDIR/civicrm-$DM_VERSION-drupal.tar.gz civicrm
# clean up
# copy all the stuff
dm_install_core "$SRC" "$TRG"
dm_install_packages "$SRC/packages" "$TRG/packages"
-for CODE in drupal; do
- echo $CODE
- [ -d $SRC/$CODE ] && $RSYNCCOMMAND $SRC/$CODE $TRG
-done
+dm_install_drupal "$SRC/drupal" "$TRG/drupal"
# delete packages that distributions on Drupal.org repalce if present
# also delete stuff that we dont really use and should not be included