distmaker - Extract function dm_install_packages()
authortotten@civicrm.org <Tim Otten>
Sat, 21 Jun 2014 10:23:37 +0000 (03:23 -0700)
committertotten@civicrm.org <Tim Otten>
Sun, 22 Jun 2014 07:53:58 +0000 (00:53 -0700)
distmaker/dists/common.sh
distmaker/dists/drupal6_php5.sh
distmaker/dists/drupal_php5.sh
distmaker/dists/drupal_sk_php5.sh
distmaker/dists/joomla_php5.sh
distmaker/dists/wordpress_php5.sh

index 1dcbddfaf9ed32d08ed0fe2ca03991004e71beb6..d0ff853c98e6275172c7e8b12d53646d005cc099 100644 (file)
@@ -63,3 +63,18 @@ function dm_install_core() {
   rm -rf $to/sql/civicrm_*.??_??.mysql
   set -e
 }
+
+## Copy all packages
+## usage: dm_install_packages <packages_repo_path> <to_path>
+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/./"
+}
index 392d6252b7c932259f37412c9adaab0d8e834dd4..5894991c73018bc22ee69a63b625c353523feca0 100755 (executable)
@@ -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
index 8d29ebdf1f91df4f4ed0dcfbae24644b1a7ce959..73a3fc548635d3d812c2748fc8b68a12b8363556 100755 (executable)
@@ -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
index e1190998cc5b8efe97439536a61d82d7aedbbe97..f52f282f3c24974c102ea15a0ada1745d26c0b40 100755 (executable)
@@ -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
index e7bd357148390e9e9e0ecd39096b8166a0f37de4..4e75cbc684a6760f75dff78944e5522525d23f40 100755 (executable)
@@ -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
index 88d6d20d025d8ed794d3e99df57c47b955fc28fd..4f62656b7947dcce2fec9a58cf9e82ec1c88d715 100644 (file)
@@ -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