From: Tim Otten Date: Tue, 24 Jun 2014 01:41:37 +0000 (-0700) Subject: Merge remote-tracking branch 'upstream/4.4' into 4.4-master-2014-06-23-18-25-12 X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=61101c0139a33917f1220f3e970b7c1293f34449;p=civicrm-core.git Merge remote-tracking branch 'upstream/4.4' into 4.4-master-2014-06-23-18-25-12 Conflicts: distmaker/dists/drupal6_php5.sh distmaker/dists/drupal_php5.sh distmaker/dists/drupal_sk_php5.sh distmaker/dists/joomla_php5.sh distmaker/dists/l10n.sh distmaker/dists/wordpress_php5.sh xml/schema/Core/MappingField.xml --- 61101c0139a33917f1220f3e970b7c1293f34449 diff --cc distmaker/dists/common.sh index 0000000000,cbd3502484..04e4db3ff1 mode 000000,100644..100644 --- a/distmaker/dists/common.sh +++ b/distmaker/dists/common.sh @@@ -1,0 -1,179 +1,179 @@@ + #!/bin/bash + + ## Delete/create a dir + ## usage: dm_reset_dirs ... + function dm_reset_dirs() { + for d in "$@" ; do + [ -d "$d" ] && rm -rf "$d" + done + + mkdir -p "$@" + } + + ## Copy files from one dir into another dir + ## usage: dm_install_dir + function dm_install_dir() { + local from="$1" + local to="$2" + + if [ ! -d "$to" ]; then + mkdir -p "$to" + fi + $DM_RSYNC -avC --exclude=.git --exclude=.svn "$from/./" "$to/./" + } + + ## Copy listed files + ## usage: dm_install_files ... + 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 ... + 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 + 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 ++ dm_install_files "$repo" "$to" sql/civicrm*.mysql sql/case_sample*.mysql + ## 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 + } + + ## 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 + + ## Note: These small folders have items that previously were not published, + ## but there's no real cost to including them, and excluding them seems + ## likely to cause confusion as the codebase evolves: + ## packages/Files packages/PHP packages/Text + + [ ! -d "$to" ] && mkdir "$to" + $DM_RSYNC -avC $excludes_rsync --include=core "$repo/./" "$to/./" + } + + ## Copy Drupal-integration module + ## usage: dm_install_drupal + function dm_install_drupal() { + local repo="$1" + local to="$2" + dm_install_dir "$repo" "$to" + + # 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 Joomla-integration module + ## usage: dm_install_joomla + function dm_install_joomla() { + local repo="$1" + local to="$2" + dm_install_dir "$repo" "$to" + + ## Before this change, the zip file included the joomla-integration + ## modules twice. The two were basically identical -- except that + ## one included .gitignore and the omitted it. We'll now omit it + ## consistently. + rm -f "$to/.gitignore" + } + + ## usage: dm_install_l10n + function dm_install_l10n() { + local repo="$1" + local to="$2" + dm_install_dir "$repo" "$to" + } + + ## usage: dm_install_wordpress + function dm_install_wordpress() { + local repo="$1" + local to="$2" + + if [ ! -d "$to" ]; then + mkdir -p "$to" + fi + $DM_RSYNC -avC \ + --exclude=.git \ + --exclude=.svn \ + --exclude=civicrm.config.php.wordpress \ + --exclude=.gitignore \ + --exclude=civicrm \ + "$repo/./" "$to/./" + ## Need --exclude=civicrm for self-building on WP site + } + + ## Generate civicrm-version.php + ## usage: dm_generate_version + function dm_generate_version() { + local to="$1" + local ufname="$2" + + # final touch + echo " '$DM_VERSION', + 'cms' => '$ufname', + 'revision' => '$DM_REVISION' ); + } + " > "$to" + } + + ## Perform a hard checkout on a given report + ## usage: dm_git_checkout + function dm_git_checkout() { + pushd "$1" + git checkout . + git checkout "$2" + popd + }