From bed9657097896ba17808b0704a0551376d1e2f87 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Fri, 1 Mar 2013 01:29:11 -0500 Subject: [PATCH] Apply fa00f5afe9 through c12d33c100 from wariocrm --- .gitignore | 140 ++++++++++++++++++++++++++++++ bin/gitify | 118 +++++++++++++++++++++++++ distmaker/distmaker.conf.dist | 13 ++- distmaker/distmaker.sh | 11 +++ distmaker/dists/drupal6_php5.sh | 5 ++ distmaker/dists/drupal_php5.sh | 5 ++ distmaker/dists/drupal_sk_php5.sh | 5 ++ distmaker/dists/joomla_php5.sh | 5 ++ distmaker/dists/wordpress_php5.sh | 5 ++ tools/bin/scripts/cli.php | 2 +- tools/scripts/phpdoc | 2 +- tools/scripts/phpunit | 3 +- 12 files changed, 309 insertions(+), 5 deletions(-) create mode 100755 bin/gitify diff --git a/.gitignore b/.gitignore index e7683df559..0fe370577c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,142 @@ *~ *.bak +CRM/ACL/DAO +CRM/Activity/DAO +CRM/Auction/DAO +CRM/Campaign/DAO +CRM/Case/DAO +CRM/Case/xml/configuration +CRM/Contact/DAO/ACLContactCache.php +CRM/Contact/DAO/Contact.php +CRM/Contact/DAO/ContactType.php +CRM/Contact/DAO/DashboardContact.php +CRM/Contact/DAO/Group.php +CRM/Contact/DAO/GroupContact.php +CRM/Contact/DAO/GroupContactCache.php +CRM/Contact/DAO/GroupNesting.php +CRM/Contact/DAO/GroupOrganization.php +CRM/Contact/DAO/Relationship.php +CRM/Contact/DAO/RelationshipType.php +CRM/Contact/DAO/SavedSearch.php +CRM/Contact/DAO/SubscriptionHistory.php +CRM/Contribute/DAO +CRM/Core/DAO/.listAll.php +CRM/Core/DAO/ActionLog.php +CRM/Core/DAO/ActionMapping.php +CRM/Core/DAO/ActionSchedule.php +CRM/Core/DAO/Address.php +CRM/Core/DAO/AddressFormat.php +CRM/Core/DAO/Batch.php +CRM/Core/DAO/Cache.php +CRM/Core/DAO/Component.php +CRM/Core/DAO/Country.php +CRM/Core/DAO/County.php +CRM/Core/DAO/Currency.php +CRM/Core/DAO/CustomField.php +CRM/Core/DAO/CustomGroup.php +CRM/Core/DAO/Dashboard.php +CRM/Core/DAO/Discount.php +CRM/Core/DAO/Domain.php +CRM/Core/DAO/Email.php +CRM/Core/DAO/EntityBatch.php +CRM/Core/DAO/EntityFile.php +CRM/Core/DAO/EntityFinancialTrxn.php +CRM/Core/DAO/EntityTag.php +CRM/Core/DAO/Extension.php +CRM/Core/DAO/File.php +CRM/Core/DAO/FinancialAccount.php +CRM/Core/DAO/FinancialTrxn.php +CRM/Core/DAO/IM.php +CRM/Core/DAO/Job.php +CRM/Core/DAO/JobLog.php +CRM/Core/DAO/LineItem.php +CRM/Core/DAO/LocBlock.php +CRM/Core/DAO/LocationType.php +CRM/Core/DAO/Log.php +CRM/Core/DAO/MailSettings.php +CRM/Core/DAO/Managed.php +CRM/Core/DAO/Mapping.php +CRM/Core/DAO/MappingField.php +CRM/Core/DAO/Menu.php +CRM/Core/DAO/MessageTemplates.php +CRM/Core/DAO/Navigation.php +CRM/Core/DAO/Note.php +CRM/Core/DAO/OpenID.php +CRM/Core/DAO/OptionGroup.php +CRM/Core/DAO/OptionValue.php +CRM/Core/DAO/PaymentProcessor.php +CRM/Core/DAO/PaymentProcessorType.php +CRM/Core/DAO/Persistent.php +CRM/Core/DAO/Phone.php +CRM/Core/DAO/Preferences.php +CRM/Core/DAO/PreferencesDate.php +CRM/Core/DAO/PrevNextCache.php +CRM/Core/DAO/PriceField.php +CRM/Core/DAO/PriceSet.php +CRM/Core/DAO/PriceSetEntity.php +CRM/Core/DAO/Setting.php +CRM/Core/DAO/StateProvince.php +CRM/Core/DAO/Tag.php +CRM/Core/DAO/Timezone.php +CRM/Core/DAO/UFField.php +CRM/Core/DAO/UFGroup.php +CRM/Core/DAO/UFJoin.php +CRM/Core/DAO/UFMatch.php +CRM/Core/DAO/Website.php +CRM/Core/DAO/Worldregion.php +CRM/Core/I18n/SchemaStructure.php +CRM/Dedupe/DAO +CRM/Event/Cart/DAO +CRM/Event/DAO +CRM/Friend/DAO +CRM/Grant/DAO +CRM/Mailing/DAO +CRM/Mailing/Event/DAO +CRM/Member/DAO +CRM/PCP/DAO +CRM/Pledge/DAO +CRM/Price/DAO +CRM/Project/DAO +CRM/Queue/DAO +CRM/Report/DAO +CRM/SMS/DAO +CRM/Standalone/OpenID/DAO +bin/setup.conf +civicrm-version.php +civicrm-version.txt +civicrm.config.php +install/langs.php +packages/.channels +packages/.depdb +packages/.depdblock +packages/.filemap +packages/.lock +packages/.registry +packages/cache +packages/doc +packages/temp +packages/test +settings_location.php +sql/civicrm.mysql +sql/civicrm_acl.??_??.mysql +sql/civicrm_acl.mysql +sql/civicrm_data.??_??.mysql +sql/civicrm_data.mysql +sql/civicrm_drop.mysql +sql/civicrm_navigation.mysql +sql/civicrm_sample.mysql +templates/CRM/common/version.tpl +tests/phpunit/CiviTest/CiviSeleniumSettings.php +tests/phpunit/CiviTest/civicrm.settings.php +tools/stats/config.php +authors.txt +CRM/Batch/DAO/ +CRM/Financial/DAO/ +drupal/ +WordPress +joomla +packages/ +tests/phpunit/CiviTest/civicrm.settings.local.php +l10n + +vendor diff --git a/bin/gitify b/bin/gitify new file mode 100755 index 0000000000..13b0f2b1c2 --- /dev/null +++ b/bin/gitify @@ -0,0 +1,118 @@ +#!/bin/bash + +## Take an existing, tar-based CiviCRM directory and convert it to a git working directory + +#### Helpers #### + +## usage: do_gitify [git-checkout-options] +function do_gitify() { + REPO="$1" + TGT="$2" + TMP="${TGT}.tmp" + shift 2 + + if [ -d "$TGT/.git" ]; then + echo "[[Already checked out git repo ($TGT) -- skip $REPO]]" + return + fi + [ -d $TGT ] || mkdir -p "$TGT" + [ -d $TMP ] && rm -rf "$TMP" + echo "[[Checkout $REPO ($TMP)]]" + echo "[git clone "$@" "$REPO" "$TMP"]" + git clone "$@" "$REPO" "$TMP" + + echo "[[Swap metadata]]" + mv "$TMP/.git" "$TGT/.git" + + echo "[[Remove local modifications]]" + pushd "$TGT" > /dev/null + git checkout -- . + popd > /dev/null + + rm -rf "$TMP" +} + +## usage: do_svnify +function do_svnify() { + REPO="$1" + TGT="$2" + shift 2 + + if [ -d "$TGT/.svn" ]; then + echo "[[Already checked out SVN repo ($TGT) -- skip $REPO]]" + return + fi + [ -d $TGT ] || mkdir -p "$TGT" + [ -d $TMP ] && rm -rf "$TMP" + echo "[[Checkout $REPO ($TMP)]]" + + echo "[svn co \"$REPO\" \"$TGT\"]" + svn co "$REPO" "$TGT" +} + +function check_dep() { + if [ -z `which git` ]; then + echo "command not found: git" + exit + fi +} + +#### Main #### + +set -e + +CIVICRM_CMS="$1" +GIT_BASE_URL="$2" +CIVICRM_ROOT="$3" +CIVICRM_L10N="$4" +CIVICRM_BRANCH="master" +if [ -z "$CIVICRM_ROOT" -o ! -d "$CIVICRM_ROOT" -o -z "$GIT_BASE_URL" -o -z "$CIVICRM_CMS" ]; then + echo "Convert a directory into a set of CiviCRM git clones" + echo "usage: $0 [--l10n]" + echo " : one of: Drupal|Drupal6|Joomla|WordPress|all" + echo " : a base URL shared by the desiried git repos (e.g. git://github.com/civicrm)" + echo " : the main directory containing CiviCRM" + echo " [l10n]: optionally fetch localization data; currently requires svn" + echo "" + echo "Note: If pointing to a pre-existing directory, your local changes may be replaced by" + echo "the pristine code from git/svn. If you've made changes, then make sure there's a backup!" + echo "" + echo "example: $0 Drupal git://github.com/wariocrm /var/www/drupal7/sites/all/modules/civicrm" + echo " (checkout core code plus Drupal 7.x integration code using Git's read-only protocol)" + echo "" + echo "example: $0 Drupal6 https://github.com/wariocrm /var/www/drupal6/sites/all/modules/civicrm" + echo " (checkout core code plus Drupal 6.x integration code using read-only HTTP protocol)" + echo "" + echo "example: $0 all git@github.com:wariocrm ~/src/civicrm l10n" + echo " (checkout core code plus Drupal 7.x, Joomla, and WordPress integration code and l10n using SSH)" + exit 1 +fi + +check_dep +do_gitify "${GIT_BASE_URL}/civicrm-core.git" "$CIVICRM_ROOT" -b "${CIVICRM_BRANCH}" +do_gitify "${GIT_BASE_URL}/civicrm-packages.git" "$CIVICRM_ROOT/packages" -b "${CIVICRM_BRANCH}" +case "$CIVICRM_CMS" in + Drupal) + do_gitify "${GIT_BASE_URL}/civicrm-drupal.git" "$CIVICRM_ROOT/drupal" -b "${CIVICRM_BRANCH}-7.x" + ;; + Drupal6) + do_gitify "${GIT_BASE_URL}/civicrm-drupal.git" "$CIVICRM_ROOT/drupal" -b "${CIVICRM_BRANCH}-6.x" + ;; + Joomla) + do_gitify "${GIT_BASE_URL}/civicrm-joomla.git" "$CIVICRM_ROOT/joomla" -b "${CIVICRM_BRANCH}" + ;; + WordPress) + do_gitify "${GIT_BASE_URL}/civicrm-wordpress.git" "$CIVICRM_ROOT/WordPress" -b "${CIVICRM_BRANCH}" + ;; + all) + do_gitify "${GIT_BASE_URL}/civicrm-drupal.git" "$CIVICRM_ROOT/drupal" -b "${CIVICRM_BRANCH}-7.x" + do_gitify "${GIT_BASE_URL}/civicrm-joomla.git" "$CIVICRM_ROOT/joomla" -b "${CIVICRM_BRANCH}" + do_gitify "${GIT_BASE_URL}/civicrm-wordpress.git" "$CIVICRM_ROOT/WordPress" -b "${CIVICRM_BRANCH}" + ;; + *) + echo "Unrecognized CMS: $CIVICRM_CMS" +esac + +if [ "$CIVICRM_L10N" == "--l10n" ]; then + do_svnify "http://svn.civicrm.org/l10n/trunk" "$CIVICRM_ROOT/l10n" +fi diff --git a/distmaker/distmaker.conf.dist b/distmaker/distmaker.conf.dist index 98ec430433..b10156c09c 100644 --- a/distmaker/distmaker.conf.dist +++ b/distmaker/distmaker.conf.dist @@ -1,8 +1,19 @@ +#!/bin/bash DM_SOURCEDIR= DM_GENFILESDIR= DM_TMPDIR= DM_TARGETDIR= + DM_PHP= DM_RSYNC= -DM_VERSION= DM_ZIP= + +DM_VERSION= + +## Git banch/tag name +DM_REF_CORE=master +DM_REF_DRUPAL=${DM_REF_CORE}-7.x +DM_REF_DRUPAL6=${DM_REF_CORE}-6.x +DM_REF_JOOMLA=${DM_REF_CORE} +DM_REF_WORDPRESS=${DM_REF_CORE} +DM_REF_PACKAGES=${DM_REF_CORE} diff --git a/distmaker/distmaker.sh b/distmaker/distmaker.sh index a98ab5d9a0..a685b8695c 100755 --- a/distmaker/distmaker.sh +++ b/distmaker/distmaker.sh @@ -149,6 +149,17 @@ case $1 in esac +## Make sure we have the right branch or tag +pushd "$DM_SOURCEDIR" +git checkout "$DM_REF_CORE" +popd +pushd "$DM_SOURCEDIR/packages" +git checkout "$DM_REF_PACKAGES" +popd +## in theory, this shouldn't matter, but GenCode is CMS-dependent, and we've been doing our past builds based on D7 +pushd "$DM_SOURCEDIR/drupal" +git checkout "$DM_REF_DRUPAL" +popd # Before anything - regenerate DAOs diff --git a/distmaker/dists/drupal6_php5.sh b/distmaker/dists/drupal6_php5.sh index 4987ce618b..68c321e5e9 100755 --- a/distmaker/dists/drupal6_php5.sh +++ b/distmaker/dists/drupal6_php5.sh @@ -20,6 +20,11 @@ RSYNCCOMMAND="$DM_RSYNC $RSYNCOPTIONS" SRC=$DM_SOURCEDIR TRG=$DM_TMPDIR/civicrm +# checkout the right code revisions +pushd "$DM_SOURCEDIR/drupal" +git checkout "$DM_REF_DRUPAL6" +popd + # make sure and clean up before if [ -d $TRG ] ; then rm -rf $TRG/* diff --git a/distmaker/dists/drupal_php5.sh b/distmaker/dists/drupal_php5.sh index 2b8dfe70a5..1513425765 100755 --- a/distmaker/dists/drupal_php5.sh +++ b/distmaker/dists/drupal_php5.sh @@ -20,6 +20,11 @@ RSYNCCOMMAND="$DM_RSYNC $RSYNCOPTIONS" SRC=$DM_SOURCEDIR TRG=$DM_TMPDIR/civicrm +# checkout the right code revisions +pushd "$DM_SOURCEDIR/drupal" +git checkout "$DM_REF_DRUPAL" +popd + # make sure and clean up before if [ -d $TRG ] ; then rm -rf $TRG/* diff --git a/distmaker/dists/drupal_sk_php5.sh b/distmaker/dists/drupal_sk_php5.sh index 4b791c3598..9a648c70f8 100755 --- a/distmaker/dists/drupal_sk_php5.sh +++ b/distmaker/dists/drupal_sk_php5.sh @@ -20,6 +20,11 @@ RSYNCCOMMAND="$DM_RSYNC $RSYNCOPTIONS" SRC=$DM_SOURCEDIR TRG=$DM_TMPDIR/civicrm +# checkout the right code revisions +pushd "$DM_SOURCEDIR/drupal" +git checkout "$DM_REF_DRUPAL" +popd + # make sure and clean up before if [ -d $TRG ] ; then rm -rf $TRG/* diff --git a/distmaker/dists/joomla_php5.sh b/distmaker/dists/joomla_php5.sh index 4700eced8d..fd727b2344 100755 --- a/distmaker/dists/joomla_php5.sh +++ b/distmaker/dists/joomla_php5.sh @@ -20,6 +20,11 @@ RSYNCCOMMAND="$DM_RSYNC $RSYNCOPTIONS" SRC=$DM_SOURCEDIR TRG=$DM_TMPDIR/civicrm +# checkout the right code revisions +pushd "$DM_SOURCEDIR/joomla" +git checkout "$DM_REF_JOOMLA" +popd + # make sure and clean up before if [ -d $TRG ] ; then rm -rf $TRG/* diff --git a/distmaker/dists/wordpress_php5.sh b/distmaker/dists/wordpress_php5.sh index 32d26a6e2e..e1cc44968b 100644 --- a/distmaker/dists/wordpress_php5.sh +++ b/distmaker/dists/wordpress_php5.sh @@ -20,6 +20,11 @@ RSYNCCOMMAND="$DM_RSYNC $RSYNCOPTIONS" SRC=$DM_SOURCEDIR TRG=$DM_TMPDIR/civicrm +# checkout the right code revisions +pushd "$DM_SOURCEDIR/WordPress" +git checkout "$DM_REF_WORDPRESS" +popd + # make sure and clean up before if [ -d $TRG ] ; then rm -rf $TRG/* diff --git a/tools/bin/scripts/cli.php b/tools/bin/scripts/cli.php index 8167298441..4db7feaa1a 100644 --- a/tools/bin/scripts/cli.php +++ b/tools/bin/scripts/cli.php @@ -33,7 +33,7 @@ ?> */ -$include_path = "packages/:" . get_include_path(); +$include_path = "../packages/:" . get_include_path(); set_include_path($include_path); class civicrm_CLI { diff --git a/tools/scripts/phpdoc b/tools/scripts/phpdoc index 73cb4af6b6..57b9c1f23c 100755 --- a/tools/scripts/phpdoc +++ b/tools/scripts/phpdoc @@ -42,5 +42,5 @@ $base_dir = dirname( dirname( __FILE__ ) ); // require config to get CiviCRM related include paths straight require_once '../civicrm.config.php'; -require "$base_dir/packages/PhpDocumentor/phpDocumentor/phpdoc.inc"; +require "$base_dir/../packages/PhpDocumentor/phpDocumentor/phpdoc.inc"; ?> diff --git a/tools/scripts/phpunit b/tools/scripts/phpunit index 7b1012daf3..5eaed2dfc0 100755 --- a/tools/scripts/phpunit +++ b/tools/scripts/phpunit @@ -38,13 +38,11 @@ */ $GLOBALS['base_dir'] = dirname( dirname( dirname( __FILE__ ) ) ); -$tools_pkgs_dir = $GLOBALS['base_dir'] . DIRECTORY_SEPARATOR . 'tools' . DIRECTORY_SEPARATOR . 'packages'; $tests_dir = $GLOBALS['base_dir'] . DIRECTORY_SEPARATOR . 'tests' . DIRECTORY_SEPARATOR . 'phpunit'; $civi_pkgs_dir = $GLOBALS['base_dir'] . DIRECTORY_SEPARATOR . 'packages'; ini_set('safe_mode', 0); ini_set('include_path', "{$GLOBALS['base_dir']}" . PATH_SEPARATOR . - "$tools_pkgs_dir" . PATH_SEPARATOR . "$tests_dir" . PATH_SEPARATOR . "$civi_pkgs_dir" . PATH_SEPARATOR . ini_get( 'include_path') ); @@ -68,6 +66,7 @@ require 'PHPUnit/TextUI/Command.php'; define('PHPUnit_MAIN_METHOD', 'PHPUnit_TextUI_Command::main'); require dirname(__FILE__) . DIRECTORY_SEPARATOR . + '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'packages' . DIRECTORY_SEPARATOR . 'PHPUnit' . DIRECTORY_SEPARATOR . -- 2.25.1