--- /dev/null
+#!/bin/bash
+
+## Copy files from one dir into another dir
+## usage: dm_install_dir <from-dir> <to-dir>
+function dm_install_dir() {
+ local from="$1"
+ local to="$2"
+
+ if [ ! -d "$to" ]; then
+ mkdir -p "$to"
+ fi
+ rsync -va "$from/./" "$to/./"
+}
+
+## Copy listed files
+## usage: dm_install_files <from-dir> <to-dir> <file1> <file2>...
+function dm_install_files() {
+ local from="$1"
+ shift
+ local to="$1"
+ shift
+
+ for file in "$@" ; do
+ [ -f "$from/$file" ] && cp -f "$from/$file" "$to/$file"
+ done
+}
+
+## usage: dm_remove_files <directory> <file1> <file2>...
+function dm_remove_files() {
+ local tgt="$1"
+ shift
+
+ for file in "$@" ; do
+ [ -f "$tgt/$file" ] && rm -f "$tgt/$file"
+ done
+}
+
+## Copy all core files
+## usage: dm_install_core <core_repo_path> <to_path>
+function dm_install_core() {
+ local repo="$1"
+ local to="$2"
+
+ for dir in css i js PEAR templates bin CRM api extern Reports install settings Civi ; do
+ [ -d "$repo/$dir" ] && dm_install_dir "$repo/$dir" "$to/$dir"
+ done
+
+ dm_install_files "$repo" "$to" {agpl-3.0,agpl-3.0.exception,gpl,README,CONTRIBUTORS}.txt
+
+ mkdir -p "$to/sql"
+ pushd "$repo" >> /dev/null
+ dm_install_files "$repo" "$to" sql/civicrm*.mysql sql/case_sample*.mysql sql/counties.US.sql.gz
+ ## TODO: for master, remove counties.US.SQL.gz
+ popd >> /dev/null
+
+ if [ -d $to/bin ] ; then
+ rm -f $to/bin/setup.sh
+ rm -f $to/bin/setup.php4.sh
+ rm -f $to/bin/setup.bat
+ fi
+
+ set +e
+ rm -rf $to/sql/civicrm_*.??_??.mysql
+ set -e
+}
. $CFFILE
fi
+. "$P/common.sh"
+
RSYNCOPTIONS="-avC $DM_EXCLUDES_RSYNC --include=core"
RSYNCCOMMAND="$DM_RSYNC $RSYNCOPTIONS"
SRC=$DM_SOURCEDIR
# checkout the right code revisions
pushd "$DM_SOURCEDIR/drupal"
+git checkout .
git checkout "$DM_REF_DRUPAL6"
popd
fi
# copy all the stuff
-for CODE in css i js packages PEAR templates bin CRM api drupal extern Reports install settings; do
+dm_install_core "$SRC" "$TRG"
+for CODE in packages drupal; do
echo $CODE
[ -d $SRC/$CODE ] && $RSYNCCOMMAND $SRC/$CODE $TRG
done
-# delete any setup.sh or setup.php4.sh if present
-if [ -d $TRG/bin ] ; then
- rm -f $TRG/bin/setup.sh
- rm -f $TRG/bin/setup.php4.sh
- rm -f $TRG/bin/setup.bat
-fi
-
-
-# copy selected sqls
-if [ ! -d $TRG/sql ] ; then
- mkdir $TRG/sql
-fi
-
-for F in $SRC/sql/civicrm*.mysql $SRC/sql/counties.US.sql.gz $SRC/sql/case_sample*.mysql; do
- cp $F $TRG/sql
-done
-
-set +e
-rm -rf $TRG/sql/civicrm_*.??_??.mysql
-set -e
-
# copy docs
-cp $SRC/agpl-3.0.txt $TRG
-cp $SRC/gpl.txt $TRG
-cp $SRC/README.txt $TRG
-cp $SRC/CONTRIBUTORS.txt $TRG
-cp $SRC/agpl-3.0.exception.txt $TRG
cp $SRC/drupal/civicrm.config.php.drupal $TRG/civicrm.config.php
# final touch
. $CFFILE
fi
+. "$P/common.sh"
+
RSYNCOPTIONS="-avC $DM_EXCLUDES_RSYNC --include=core"
RSYNCCOMMAND="$DM_RSYNC $RSYNCOPTIONS"
SRC=$DM_SOURCEDIR
# checkout the right code revisions
pushd "$DM_SOURCEDIR/drupal"
+git checkout .
git checkout "$DM_REF_DRUPAL"
popd
fi
# copy all the stuff
-for CODE in css i js packages PEAR templates bin CRM api drupal extern Reports install settings; do
+dm_install_core "$SRC" "$TRG"
+for CODE in packages drupal; do
echo $CODE
[ -d $SRC/$CODE ] && $RSYNCCOMMAND $SRC/$CODE $TRG
done
-# delete any setup.sh or setup.php4.sh if present
-if [ -d $TRG/bin ] ; then
- rm -f $TRG/bin/setup.sh
- rm -f $TRG/bin/setup.php4.sh
- rm -f $TRG/bin/setup.bat
-fi
-
-
-# copy selected sqls
-if [ ! -d $TRG/sql ] ; then
- mkdir $TRG/sql
-fi
-
-for F in $SRC/sql/civicrm*.mysql $SRC/sql/counties.US.sql.gz $SRC/sql/case_sample*.mysql; do
- cp $F $TRG/sql
-done
-
-set +e
-rm -rf $TRG/sql/civicrm_*.??_??.mysql
-set -e
-
-# copy docs
-cp $SRC/agpl-3.0.txt $TRG
-cp $SRC/gpl.txt $TRG
-cp $SRC/README.txt $TRG
-cp $SRC/CONTRIBUTORS.txt $TRG
-cp $SRC/agpl-3.0.exception.txt $TRG
cp $SRC/drupal/civicrm.config.php.drupal $TRG/civicrm.config.php
# set full version in .info files
. $CFFILE
fi
+. "$P/common.sh"
+
RSYNCOPTIONS="-avC $DM_EXCLUDES_RSYNC --include=core"
RSYNCCOMMAND="$DM_RSYNC $RSYNCOPTIONS"
SRC=$DM_SOURCEDIR
fi
# copy all the stuff
-for CODE in css i js packages PEAR templates bin CRM api drupal extern Reports install settings; do
+dm_install_core "$SRC" "$TRG"
+for CODE in packages drupal; do
echo $CODE
[ -d $SRC/$CODE ] && $RSYNCCOMMAND $SRC/$CODE $TRG
done
-# delete any setup.sh or setup.php4.sh if present
-if [ -d $TRG/bin ] ; then
- rm -f $TRG/bin/setup.sh
- rm -f $TRG/bin/setup.php4.sh
- rm -f $TRG/bin/setup.bat
-fi
-
# delete packages that distributions on Drupal.org repalce if present
# also delete stuff that we dont really use and should not be included
rm -rf $TRG/packages/dompdf
rm -rf $TRG/joomla
rm -rf $TRG/WordPress
-# copy selected sqls
-if [ ! -d $TRG/sql ] ; then
- mkdir $TRG/sql
-fi
-
-for F in $SRC/sql/civicrm*.mysql $SRC/sql/counties.US.sql.gz $SRC/sql/case_sample*.mysql; do
- cp $F $TRG/sql
-done
-
-set +e
-rm -rf $TRG/sql/civicrm_*.??_??.mysql
-set -e
-
# copy docs
-cp $SRC/agpl-3.0.txt $TRG
-cp $SRC/gpl.txt $TRG
-cp $SRC/README.txt $TRG
-cp $SRC/CONTRIBUTORS.txt $TRG
-cp $SRC/agpl-3.0.exception.txt $TRG
cp $SRC/drupal/civicrm.config.php.drupal $TRG/civicrm.config.php
# final touch
. $CFFILE
fi
+. "$P/common.sh"
+
RSYNCOPTIONS="-avC $DM_EXCLUDES_RSYNC --include=core"
RSYNCCOMMAND="$DM_RSYNC $RSYNCOPTIONS"
SRC=$DM_SOURCEDIR
fi
# copy all the rest of the stuff
-for CODE in css i install js packages PEAR templates bin joomla CRM api extern Reports settings; do
+dm_install_core "$SRC" "$TRG"
+for CODE in packages joomla ; do
echo $CODE
[ -d $SRC/$CODE ] && $RSYNCCOMMAND $SRC/$CODE $TRG
done
-# delete any setup.sh or setup.php4.sh if present
-if [ -d $TRG/bin ] ; then
- rm -f $TRG/bin/setup.sh
- rm -f $TRG/bin/setup.php4.sh
- rm -f $TRG/bin/setup.bat
-fi
-
-# copy selected sqls
-if [ ! -d $TRG/sql ] ; then
- mkdir $TRG/sql
-fi
-for F in $SRC/sql/civicrm*.mysql $SRC/sql/counties.US.sql.gz $SRC/sql/case_sample*.mysql; do
- cp $F $TRG/sql
-done
-
-set +e
-rm -rf $TRG/sql/civicrm_*.??_??.mysql
-set -e
-
# copy docs
-cp $SRC/agpl-3.0.txt $TRG
-cp $SRC/gpl.txt $TRG
-cp $SRC/README.txt $TRG
-cp $SRC/CONTRIBUTORS.txt $TRG
-cp $SRC/agpl-3.0.exception.txt $TRG
cp $SRC/civicrm.config.php $TRG
# final touch
. $CFFILE
fi
+. "$P/common.sh"
+
RSYNCOPTIONS="-avC $DM_EXCLUDES_RSYNC --include=core"
RSYNCCOMMAND="$DM_RSYNC $RSYNCOPTIONS"
SRC=$DM_SOURCEDIR
fi
# copy all the stuff
-for CODE in css i js packages PEAR templates bin CRM api extern Reports install settings; do
+dm_install_core "$SRC" "$TRG/civicrm/civicrm"
+for CODE in packages ; do
echo $CODE
[ -d $SRC/$CODE ] && $RSYNCCOMMAND $SRC/$CODE $TRG/civicrm/civicrm
done
-# delete any setup.sh or setup.php4.sh if present
-if [ -d $TRG/civicrm/civicrm/bin ] ; then
- rm -f $TRG/civicrm/civicrm/bin/setup.sh
- rm -f $TRG/civicrm/civicrm/bin/setup.php4.sh
- rm -f $TRG/civicrm/civicrm/bin/setup.bat
-fi
-
-# copy selected sqls
-if [ ! -d $TRG/civicrm/civicrm/sql ] ; then
- mkdir $TRG/civicrm/civicrm/sql
-fi
-
-for F in $SRC/sql/civicrm*.mysql $SRC/sql/counties.US.sql.gz $SRC/sql/case_sample*.mysql; do
- cp $F $TRG/civicrm/civicrm/sql
-done
-
-set +e
-rm -rf $TRG/civicrm/civicrm/sql/civicrm_*.??_??.mysql
-set -e
-
for F in $SRC/WordPress/*; do
cp $F $TRG/civicrm
done
rm -f $TRG/civicrm/civicrm.config.php.wordpress
# copy docs
-cp $SRC/agpl-3.0.txt $TRG/civicrm/civicrm
-cp $SRC/gpl.txt $TRG/civicrm/civicrm
-cp $SRC/README.txt $TRG/civicrm/civicrm
cp $SRC/WordPress/civicrm.config.php.wordpress $TRG/civicrm/civicrm/civicrm.config.php
# final touch