4 ## usage: dm_reset_dirs <path1> <path2> ...
5 function dm_reset_dirs
() {
7 [ -d "$d" ] && rm -rf "$d"
13 ## Copy files from one dir into another dir
14 ## usage: dm_install_dir <from-dir> <to-dir>
15 function dm_install_dir
() {
19 if [ ! -d "$to" ]; then
22 ${DM_RSYNC:-rsync} -avC --exclude=.git
--exclude=.svn
"$from/./" "$to/./"
26 ## usage: dm_install_files <from-dir> <to-dir> <file1> <file2>...
27 function dm_install_files
() {
34 [ -f "$from/$file" ] && cp -f "$from/$file" "$to/$file"
38 ## usage: dm_remove_files <directory> <file1> <file2>...
39 function dm_remove_files
() {
44 [ -f "$tgt/$file" ] && rm -f "$tgt/$file"
48 ## Copy all bower dependencies
49 function dm_install_bower
() {
53 local excludes_rsync
=""
54 for exclude
in .git .svn
{T
,t
}est
{,s
} {D
,d
}oc
{,s
} {E
,e
}xample
{,s
} ; do
55 excludes_rsync
="--exclude=${exclude} ${excludes_rsync}"
58 [ ! -d "$to" ] && mkdir
"$to"
59 ${DM_RSYNC:-rsync} -avC $excludes_rsync "$repo/./" "$to/./"
62 ## Copy all core files
63 ## usage: dm_install_core <core_repo_path> <to_path>
64 function dm_install_core
() {
68 for dir
in ang css i js PEAR templates bin CRM api extern Reports
install settings Civi partials
; do
69 [ -d "$repo/$dir" ] && dm_install_dir
"$repo/$dir" "$to/$dir"
72 dm_install_files
"$repo" "$to" {agpl-3.0
,agpl-3.0.exception
,gpl
,README
,CONTRIBUTORS
}.txt
73 dm_install_files
"$repo" "$to" composer.json composer.lock bower.json package.json Civi.php
76 pushd "$repo" >> /dev
/null
77 dm_install_files
"$repo" "$to" sql
/civicrm
*.mysql
sql
/case_sample
*.mysql
78 ## TODO: for master, remove counties.US.SQL.gz
81 if [ -d $to/bin
] ; then
82 rm -f $to/bin
/setup.sh
83 rm -f $to/bin
/setup.php4.sh
84 rm -f $to/bin
/setup.bat
88 rm -rf $to/sql
/civicrm_
*.??_??.mysql
93 ## usage: dm_install_packages <packages_repo_path> <to_path>
94 function dm_install_packages
() {
98 local excludes_rsync
=""
99 for exclude
in .git .svn _ORIGINAL_ SeleniumRC PHPUnit PhpDocumentor SymfonyComponents amavisd-new git-footnote PHP
/CodeCoverage
; do
100 excludes_rsync
="--exclude=${exclude} ${excludes_rsync}"
103 ## Note: These small folders have items that previously were not published,
104 ## but there's no real cost to including them, and excluding them seems
105 ## likely to cause confusion as the codebase evolves:
106 ## packages/Files packages/PHP packages/Text
108 [ ! -d "$to" ] && mkdir
"$to"
109 ${DM_RSYNC:-rsync} -avC $excludes_rsync --include=core
"$repo/./" "$to/./"
112 ## Copy Drupal-integration module
113 ## usage: dm_install_drupal <drupal_repo_path> <to_path>
114 function dm_install_drupal
() {
117 dm_install_dir
"$repo" "$to"
119 # Set full version in .info files. See CRM-15768.
120 local MODULE_DIRS
=`find "$to" -type f -name "*.info"`
121 for INFO
in $MODULE_DIRS; do
122 if [ $
(uname
) = "Darwin" ]; then
124 sed -i '' "s/version = \([0-9]*\.x-\)[1-9.]*/version = \1$DM_VERSION/g" $INFO
127 sed -i'' "s/version = \([0-9]*\.x-\)[1-9.]*/version = \1$DM_VERSION/g" $INFO
131 for f
in "$to/.gitignore" "$to/.toxic.json" ; do
138 ## Copy Joomla-integration module
139 ## usage: dm_install_joomla <joomla_repo_path> <to_path>
140 function dm_install_joomla
() {
143 dm_install_dir
"$repo" "$to"
145 ## Before this change, the zip file included the joomla-integration
146 ## modules twice. The two were basically identical -- except that
147 ## one included .gitignore and the omitted it. We'll now omit it
150 for f
in "$to/.gitignore" "$to/.toxic.json" ; do
157 ## usage: dm_install_l10n <l10n_repo_path> <to_path>
158 function dm_install_l10n
() {
161 dm_install_dir
"$repo" "$to"
164 ## Copy composer's "vendor" folder
165 ## usage: dm_install_vendor <from_path> <to_path>
166 function dm_install_vendor
() {
170 local excludes_rsync
=""
171 for exclude
in .git .svn
{T
,t
}est
{,s
} {D
,d
}oc
{,s
} {E
,e
}xample
{,s
} ; do
172 excludes_rsync
="--exclude=${exclude} ${excludes_rsync}"
175 [ ! -d "$to" ] && mkdir
"$to"
176 ${DM_RSYNC:-rsync} -avC $excludes_rsync "$repo/./" "$to/./"
179 ## usage: dm_install_wordpress <wp_repo_path> <to_path>
180 function dm_install_wordpress
() {
184 if [ ! -d "$to" ]; then
187 ${DM_RSYNC:-rsync} -avC \
190 --exclude=civicrm.config.php.wordpress \
191 --exclude=.toxic.json \
192 --exclude=.gitignore \
195 ## Need --exclude=civicrm for self-building on WP site
199 ## Generate the "bower_components" folder.
200 ## usage: dm_generate_bower <repo_path>
201 function dm_generate_bower
() {
204 ${DM_NPM:-npm} install
205 ${DM_NODE:-node} node_modules
/bower
/bin
/bower
install
209 ## Generate the composer "vendor" folder
210 ## usage: dm_generate_vendor <repo_path>
211 function dm_generate_vendor
() {
214 ${DM_COMPOSER:-composer} install
218 ## Generate civicrm-version.php
219 ## usage: dm_generate_version <file> <ufname>
220 function dm_generate_version
() {
226 function civicrmVersion( ) {
227 return array( 'version' => '$DM_VERSION',
229 'revision' => '$DM_REVISION' );
234 ## Perform a hard checkout on a given report
235 ## usage: dm_git_checkout <repo_path> <tree-ish>
236 function dm_git_checkout
() {