From: totten@civicrm.org Date: Sat, 21 Jun 2014 10:23:37 +0000 (-0700) Subject: distmaker - Extract function dm_install_packages() X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=9f0ca23dd0b1a92f19f486ec6ea81baa8b92d91e;p=civicrm-core.git distmaker - Extract function dm_install_packages() --- diff --git a/distmaker/dists/common.sh b/distmaker/dists/common.sh index 1dcbddfaf9..d0ff853c98 100644 --- a/distmaker/dists/common.sh +++ b/distmaker/dists/common.sh @@ -63,3 +63,18 @@ function dm_install_core() { rm -rf $to/sql/civicrm_*.??_??.mysql set -e } + +## Copy all packages +## usage: dm_install_packages +function dm_install_packages() { + local repo="$1" + local to="$2" + + local excludes_rsync="" + for exclude in .git .svn _ORIGINAL_ SeleniumRC PHPUnit PhpDocumentor SymfonyComponents amavisd-new git-footnote ; do + excludes_rsync="--exclude=${exclude} ${excludes_rsync}" + done + + [ ! -d "$to" ] && mkdir "$to" + rsync -avC $excludes_rsync --include=core "$repo/./" "$to/./" +} diff --git a/distmaker/dists/drupal6_php5.sh b/distmaker/dists/drupal6_php5.sh index 392d6252b7..5894991c73 100755 --- a/distmaker/dists/drupal6_php5.sh +++ b/distmaker/dists/drupal6_php5.sh @@ -36,7 +36,8 @@ fi # copy all the stuff dm_install_core "$SRC" "$TRG" -for CODE in packages drupal; do +dm_install_packages "$SRC/packages" "$TRG/packages" +for CODE in drupal; do echo $CODE [ -d $SRC/$CODE ] && $RSYNCCOMMAND $SRC/$CODE $TRG done diff --git a/distmaker/dists/drupal_php5.sh b/distmaker/dists/drupal_php5.sh index 8d29ebdf1f..73a3fc5486 100755 --- a/distmaker/dists/drupal_php5.sh +++ b/distmaker/dists/drupal_php5.sh @@ -35,7 +35,8 @@ fi # copy all the stuff dm_install_core "$SRC" "$TRG" -for CODE in packages drupal; do +dm_install_packages "$SRC/packages" "$TRG/packages" +for CODE in drupal; do echo $CODE [ -d $SRC/$CODE ] && $RSYNCCOMMAND $SRC/$CODE $TRG done diff --git a/distmaker/dists/drupal_sk_php5.sh b/distmaker/dists/drupal_sk_php5.sh index e1190998cc..f52f282f3c 100755 --- a/distmaker/dists/drupal_sk_php5.sh +++ b/distmaker/dists/drupal_sk_php5.sh @@ -34,7 +34,8 @@ fi # copy all the stuff dm_install_core "$SRC" "$TRG" -for CODE in packages drupal; do +dm_install_packages "$SRC/packages" "$TRG/packages" +for CODE in drupal; do echo $CODE [ -d $SRC/$CODE ] && $RSYNCCOMMAND $SRC/$CODE $TRG done diff --git a/distmaker/dists/joomla_php5.sh b/distmaker/dists/joomla_php5.sh index e7bd357148..4e75cbc684 100755 --- a/distmaker/dists/joomla_php5.sh +++ b/distmaker/dists/joomla_php5.sh @@ -34,7 +34,8 @@ fi # copy all the rest of the stuff dm_install_core "$SRC" "$TRG" -for CODE in packages joomla ; do +dm_install_packages "$SRC/packages" "$TRG/packages" +for CODE in joomla ; do echo $CODE [ -d $SRC/$CODE ] && $RSYNCCOMMAND $SRC/$CODE $TRG done diff --git a/distmaker/dists/wordpress_php5.sh b/distmaker/dists/wordpress_php5.sh index 88d6d20d02..4f62656b79 100644 --- a/distmaker/dists/wordpress_php5.sh +++ b/distmaker/dists/wordpress_php5.sh @@ -46,10 +46,7 @@ fi # copy all the stuff dm_install_core "$SRC" "$TRG/civicrm/civicrm" -for CODE in packages ; do - echo $CODE - [ -d $SRC/$CODE ] && $RSYNCCOMMAND $SRC/$CODE $TRG/civicrm/civicrm -done +dm_install_packages "$SRC/packages" "$TRG/civicrm/civicrm/packages" for F in $SRC/WordPress/*; do cp $F $TRG/civicrm