Skip to content

Commit

Permalink
Merge pull request #891 from totten/master-d10dev
Browse files Browse the repository at this point in the history
drupal{9,10}-dev - Enable symlink for core code
  • Loading branch information
totten authored Nov 26, 2024
2 parents 1556891 + cee0be3 commit 42949af
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 9 deletions.
9 changes: 5 additions & 4 deletions app/config/drupal10-dev/download.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@ pushd "$WEB_ROOT" >> /dev/null
git_cache_clone "civicrm/civicrm-core" -b "$CIVI_VERSION" src/civicrm-core
git_cache_clone "civicrm/civicrm-drupal-8" -b "$CIVI_VERSION" src/civicrm-drupal-8
git_cache_clone "civicrm/civicrm-packages" -b "$CIVI_VERSION" src/civicrm-packages
composer config repositories.civicrm-core '{"type": "path", "url": "./src/civicrm-core", "options": { "symlink": false } }'
composer config repositories.civicrm-drupal-8 '{"type": "path", "url": "./src/civicrm-drupal-8", "options": { "symlink": false }}'
composer config repositories.civicrm-packages '{"type": "path", "url": "./src/civicrm-packages", "options": { "symlink": false }}'
## The symlink:false helps when running the installation step. We should probably fix that...

if civicrm_check_requested_ver '<' 5.81.alpha1 ; then _composer_symlink=false ; else _composer_symlink=true ; fi
composer config repositories.civicrm-core '{"type": "path", "url": "./src/civicrm-core", "options": { "symlink": '$_composer_symlink' } }'
composer config repositories.civicrm-drupal-8 '{"type": "path", "url": "./src/civicrm-drupal-8", "options": { "symlink": '$_composer_symlink' }}'
composer config repositories.civicrm-packages '{"type": "path", "url": "./src/civicrm-packages", "options": { "symlink": '$_composer_symlink' }}'

civibuild_apply_user_extras
civicrm_download_composer_d8 vendor/civicrm/civicrm-core
Expand Down
9 changes: 5 additions & 4 deletions app/config/drupal9-dev/download.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@ pushd "$WEB_ROOT" >> /dev/null
git_cache_clone "civicrm/civicrm-core" -b "$CIVI_VERSION" src/civicrm-core
git_cache_clone "civicrm/civicrm-drupal-8" -b "$CIVI_VERSION" src/civicrm-drupal-8
git_cache_clone "civicrm/civicrm-packages" -b "$CIVI_VERSION" src/civicrm-packages
composer config repositories.civicrm-core '{"type": "path", "url": "./src/civicrm-core", "options": { "symlink": false } }'
composer config repositories.civicrm-drupal-8 '{"type": "path", "url": "./src/civicrm-drupal-8", "options": { "symlink": false }}'
composer config repositories.civicrm-packages '{"type": "path", "url": "./src/civicrm-packages", "options": { "symlink": false }}'
## The symlink:false helps when running the installation step. We should probably fix that...

if civicrm_check_requested_ver '<' 5.81.alpha1 ; then _composer_symlink=false ; else _composer_symlink=true ; fi
composer config repositories.civicrm-core '{"type": "path", "url": "./src/civicrm-core", "options": { "symlink": '$_composer_symlink' } }'
composer config repositories.civicrm-drupal-8 '{"type": "path", "url": "./src/civicrm-drupal-8", "options": { "symlink": '$_composer_symlink' }}'
composer config repositories.civicrm-packages '{"type": "path", "url": "./src/civicrm-packages", "options": { "symlink": '$_composer_symlink' }}'

civibuild_apply_user_extras
civicrm_download_composer_d8 vendor/civicrm/civicrm-core
Expand Down
20 changes: 19 additions & 1 deletion src/civibuild.lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,8 @@ function civicrm_download_composer_d8() {
*) echo 'No Extra Patch required' ; ;;
esac

composer require "${EXTRA_COMPOSER[@]}" civicrm/civicrm-{core,packages,drupal-8}:"$CIVI_VERSION_COMP" --prefer-source -W
composer config 'preferred-install.civicrm/*' source
composer require "${EXTRA_COMPOSER[@]}" civicrm/civicrm-{core,packages,drupal-8}:"$CIVI_VERSION_COMP" -W
[ -n "$EXTRA_PATCH" ] && git scan am -N "${EXTRA_PATCH[@]}"

if [ -z "$CIVI_ROOT" ]; then
Expand Down Expand Up @@ -1013,6 +1014,23 @@ function civicrm_check_ver() {
fi
}

###############################################################################
## Check if the requested version of CiviCRM (*not yet downloaded*) matches some condition.
## usage: civicrm_check_ver <op> <target>
## example: if civicrm_check_ver '>=' '5.43' ; then echo NEW; else echo OLD; fi
function civicrm_check_requested_ver() {
cvutil_assertvars civicrm_check_requested_ver CIVI_VERSION
local ver="$CIVI_VERSION"
if [[ "$ver" == "master" ]]; then
ver=9999999.9999.9999
fi
if env ACTUAL="$ver" OP="$1" EXPECT="$2" php -r 'exit(version_compare(getenv("ACTUAL"), getenv("EXPECT"), getenv("OP"))?0:1);'; then
return 0
else
return 1
fi
}

###############################################################################
## usage: civicrm_ext_download_bare <key> <path>
function civicrm_ext_download_bare() {
Expand Down

0 comments on commit 42949af

Please sign in to comment.