/
AegirSetupC.sh.txt
2740 lines (2637 loc) · 91 KB
/
AegirSetupC.sh.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/bin/bash
###----------------------------------------###
###
### Octopus Aegir Installer
###
### Copyright (C) 2010-2013 Omega8.cc
### noc@omega8.cc www.omega8.cc
###
### This program is free software. You can
### redistribute it and/or modify it under
### the terms of the GNU GPL as published by
### the Free Software Foundation, version 2
### or later.
###
### This program is distributed in the hope
### that it will be useful, but WITHOUT ANY
### WARRANTY; without even the implied
### warranty of MERCHANTABILITY or FITNESS
### FOR A PARTICULAR PURPOSE. See the GNU GPL
### for more details.
###
### You should have received a copy of the
### GNU GPL along with this program.
### If not, see http://www.gnu.org/licenses/
###
### Code: http://code.aegir.cc/aegir
###
###----------------------------------------###
###----------------------------------------###
### DON'T EDIT ANYTHING BELOW THIS LINE ###
###----------------------------------------###
_INSTALLER_VERSION=EDIT_INSTALLER_VERSION
###---### Distro config.
#
_CIVICRM_M6=EDIT_CIVICRM_M6
_CIVICRM_M7=EDIT_CIVICRM_M7
_COD=EDIT_COD
_COM_MERCE=EDIT_COM_MERCE
_COMMERCE=EDIT_COMMERCE
_D6COMMONS=EDIT_D6COMMONS
_D7COMMONS=EDIT_D7COMMONS
_DRUPAL7=EDIT_DRUPAL7
_DRUPAL7D="EDIT_DRUPAL7-dev"
_DRUPAL7P="EDIT_DRUPAL7-prod"
_DRUPAL7S="EDIT_DRUPAL7-stage"
_DRUPAL8=EDIT_DRUPAL8
_DRUPAL_EDGE_8=EDIT_DRUPAL_EDGE_8
_MANAGINGNEWS=EDIT_MANAGINGNEWS
_NODESTREAM7=EDIT_NODESTREAM7
_OPEN_DEALS=EDIT_OPEN_DEALS
_OPENACADEMY=EDIT_OPENACADEMY
_OPENATRIUM6=EDIT_OPENATRIUM6
_OPENATRIUM7=EDIT_OPENATRIUM7
_OPENBLOG=EDIT_OPENBLOG
_OPENCHURCH=EDIT_OPENCHURCH
_OPENDEALS=EDIT_OPENDEALS
_OPENOUTREACH=EDIT_OPENOUTREACH
_OPENPUBLISH=EDIT_OPENPUBLISH
_OPENSCHOLAR=EDIT_OPENSCHOLAR
_PANOPOLY=EDIT_PANOPOLY
_PROSEPOINT=EDIT_PROSEPOINT
_RECRUITER=EDIT_RECRUITER
_SMALLCORE6=EDIT_SMALLCORE6
_SMALLCORE7=EDIT_SMALLCORE7
_SMALLCORE8=EDIT_SMALLCORE8
_SPARK=EDIT_SPARK
_TOTEM=EDIT_TOTEM
_UBER_CART_SEVEN=EDIT_UBER_CART_SEVEN
_UBERCART=EDIT_UBERCART
###---### Main config.
#
_AEGIR_VERSION=EDIT_AEGIR_VERSION
_ALL_DISTRO=EDIT_ALL_DISTRO
_ALLOW_UNSUPPORTED=EDIT_ALLOW_UNSUPPORTED
_AUTOPILOT=EDIT_AUTOPILOT
_BOA_REPO_GIT_URL=EDIT_BOA_REPO_GIT_URL
_BOA_REPO_NAME=EDIT_BOA_REPO_NAME
_CLIENT_CORES=EDIT_CLIENT_CORES
_CLIENT_OPTION=EDIT_CLIENT_OPTION
_DEBUG_MODE=EDIT_DEBUG_MODE
_DISTRO=EDIT_DISTRO
_DOMAIN=EDIT_DOMAIN
_DRUSH_VERSION=EDIT_DRUSH_VERSION
_HM_DISTRO=EDIT_HM_DISTRO
_HM_ONLY=EDIT_HM_ONLY
_HOT_SAUCE=EDIT_HOT_SAUCE
_LAST_ALL=EDIT_LAST_ALL
_LAST_HMR=EDIT_LAST_HMR
_LASTNUM=EDIT_LASTNUM
_NOW=EDIT_NOW
_O_CONTRIB_UP=EDIT_O_CONTRIB_UP
_PHP_CLI_VERSION=EDIT_PHP_CLI_VERSION
_PHP_FPM_VERSION=EDIT_PHP_FPM_VERSION
_PLATFORMS_LIST="EDIT_PLATFORMS_LIST"
_PURGE_FOR_SEVEN=EDIT_PURGE_FOR_SEVEN
_PURGE_MODE=EDIT_PURGE_MODE
_SPINNER=EDIT_SPINNER
_SRCDIR=/opt/tmp/files
_STATUS=INIT
_T_BUILD=EDIT_T_BUILD
_THIS_DB_HOST=EDIT_THIS_DB_HOST
_TODAY=`date +%y%m%d`
_USE_CURRENT=EDIT_USE_CURRENT
_USE_STOCK=EDIT_USE_STOCK
_WEBG=EDIT_WEBG
#
_USER=EDIT_USER
_ROOT="/data/disk/$_USER"
_AEGIR_ROOT="$_ROOT/aegir/distro/$_HM_DISTRO"
_PREV_AEGIR_ROOT="$_ROOT/aegir/distro/$_LAST_HMR"
_LOG=/var/backups/octopus-$_USER-$_NOW.log
#
if [ "$_PHP_CLI_VERSION" != "5.2" ] && [ -x "/opt/local/bin/php" ] ; then
_L_PHP_CLI=/opt/local/bin
else
_L_PHP_CLI=/usr/local/bin
fi
if [ "$_PHP_FPM_VERSION" != "5.2" ] || [ "$_PHP_CLI_VERSION" != "5.2" ] ; then
_D_5_ALLOW=NO
else
_D_5_ALLOW=YES
fi
if [ "$_PHP_FPM_VERSION" != "5.2" ] && [ "$_PHP_CLI_VERSION" != "5.2" ] ; then
_D_8_ALLOW=YES
else
_D_8_ALLOW=NO
fi
_DRUSHCMD="$_L_PHP_CLI/php $_ROOT/tools/drush/drush.php"
_DRUSH5CMD="$_L_PHP_CLI/php /opt/tools/drush/5/drush/drush.php"
if [ "$_PHP_CLI_VERSION" = "5.2" ] && [ -x "/usr/local/bin/php52" ] ; then
_DRUSHCMD="/usr/local/bin/php52 $_ROOT/tools/drush/drush.php"
fi
#
SHELL=/bin/bash
PATH=$_L_PHP_CLI:/usr/local/sbin:/usr/sbin:/usr/bin:/sbin:/bin
###---### Functions.
#
# Noticeable messages.
msg () {
echo "Octopus [`date`] ==> $*"
}
#
# Simple prompt.
prompt_yes_no () {
if [ "$_AUTOPILOT" = "YES" ]; then
return 0
else
while true ; do
printf "$* [Y/n] "
read answer
if [ -z "$answer" ] ; then
return 0
fi
case $answer in
[Yy]|[Yy][Ee][Ss])
return 0
;;
[Nn]|[Nn][Oo])
return 1
;;
*)
echo "Please answer yes or no"
;;
esac
done
fi
}
#
# Small spinner.
mrun () {
CMD="$1"
touch busy
if [ "$_SPINNER" = "YES" ] ; then
bash $_SRCDIR/spinner busy &
fi
if $CMD >> $_LOG; then
rm busy
sleep 1
return 0
fi
}
#
# Download and extract from dev/distro, then delete.
get_distro_ext () {
if [ ! -z $1 ] ; then
wget -q -U iCab http://files.aegir.cc/distro/$1
tar -xzf $1
rm -f $1
fi
}
#
# Create standard directories.
fix_dirs_files () {
rm -f ./*.txt
rm -f ./modules/*.txt
rm -f ./themes/*.txt
rm -f -r ./modules/cookie_cache_bypass
mkdir -p ./sites/default/files
mkdir -p ./cache/{normal,perm}
chmod -R 777 ./cache
if [ -e "./sites/default/default.settings.php" ] ; then
cp -af ./sites/default/default.settings.php ./sites/default/settings.php
fi
chmod a+rw ./sites/default/settings.php
chmod a+rwx ./sites/default/files
mkdir -p ./profiles
mkdir -p ./sites/all/{modules,libraries,themes}
rm -f ./core/modules/*.txt
rm -f ./core/themes/*.txt
rm -f ./modules/*.txt
rm -f ./themes/*.txt
rm -f ./sites/all/*.txt
echo empty > ./profiles/EMPTY.txt
echo empty > ./sites/all/EMPTY.txt
echo empty > ./sites/all/modules/EMPTY.txt
echo empty > ./sites/all/libraries/EMPTY.txt
echo empty > ./sites/all/themes/EMPTY.txt
chmod 02775 ./profiles &> /dev/null
chmod 0751 ./sites
chmod 0751 ./sites/all
chmod 02775 ./sites/all/{modules,libraries,themes}
cp -af /opt/tmp/$_BOA_REPO_NAME/aegir/conf/get.htaccess.txt ./.htaccess
cp -af /opt/tmp/$_BOA_REPO_NAME/aegir/conf/crossdomain.xml ./
}
#
# Create D6 symlinks.
create_d6_symlinks () {
if [ ! -L "includes" ] ; then
ln -sf $_D6_CORE_DIR/.htaccess .htaccess
ln -sf $_D6_CORE_DIR/boost_stats.php boost_stats.php
ln -sf $_D6_CORE_DIR/cron.php cron.php
ln -sf $_D6_CORE_DIR/crossdomain.xml crossdomain.xml
ln -sf $_D6_CORE_DIR/includes includes
ln -sf $_D6_CORE_DIR/index.php index.php
ln -sf $_D6_CORE_DIR/install.php install.php
ln -sf $_D6_CORE_DIR/misc misc
ln -sf $_D6_CORE_DIR/modules modules
ln -sf $_D6_CORE_DIR/themes themes
ln -sf $_D6_CORE_DIR/update.php update.php
ln -sf $_D6_CORE_DIR/xmlrpc.php xmlrpc.php
cp -af $_D6_CORE_DIR/sites ./
fi
if [ ! -L "$_OCTO_PLPATH/profiles" ] && [ -d "$_SHRD_PLPATH/profiles" ] ; then
rm -f -r $_OCTO_PLPATH/profiles
ln -s $_SHRD_PLPATH/profiles $_OCTO_PLPATH/profiles
fi
}
#
# Create D7 symlinks.
create_d7_symlinks () {
if [ ! -L "web.config" ] ; then
ln -sf $_D7_CORE_DIR/.htaccess .htaccess
ln -sf $_D7_CORE_DIR/authorize.php authorize.php
ln -sf $_D7_CORE_DIR/cron.php cron.php
ln -sf $_D7_CORE_DIR/crossdomain.xml crossdomain.xml
ln -sf $_D7_CORE_DIR/includes includes
ln -sf $_D7_CORE_DIR/index.php index.php
ln -sf $_D7_CORE_DIR/install.php install.php
ln -sf $_D7_CORE_DIR/misc misc
ln -sf $_D7_CORE_DIR/modules modules
ln -sf $_D7_CORE_DIR/themes themes
ln -sf $_D7_CORE_DIR/update.php update.php
ln -sf $_D7_CORE_DIR/web.config web.config
ln -sf $_D7_CORE_DIR/xmlrpc.php xmlrpc.php
cp -af $_D7_CORE_DIR/sites ./
fi
if [ ! -L "$_OCTO_PLPATH/profiles" ] && [ -d "$_SHRD_PLPATH/profiles" ] ; then
rm -f -r $_OCTO_PLPATH/profiles
ln -s $_SHRD_PLPATH/profiles $_OCTO_PLPATH/profiles
fi
}
#
# Create D8 symlinks.
create_d8_symlinks () {
if [ ! -L "core" ] ; then
ln -sf $_D8_CORE_DIR/.htaccess .htaccess
ln -sf $_D8_CORE_DIR/core core
ln -sf $_D8_CORE_DIR/crossdomain.xml crossdomain.xml
ln -sf $_D8_CORE_DIR/index.php index.php
ln -sf $_D8_CORE_DIR/web.config web.config
cp -af $_D8_CORE_DIR/sites ./
fi
if [ ! -L "$_OCTO_PLPATH/profiles" ] && [ -d "$_SHRD_PLPATH/profiles" ] ; then
rm -f -r $_OCTO_PLPATH/profiles
ln -s $_SHRD_PLPATH/profiles $_OCTO_PLPATH/profiles
fi
}
#
# Rename D7 profiles.
rename_drupal7_profiles () {
for Files in `find ./profiles -type f`
do
sed -i "s/name = Minimal/name = Vanilla Minimal/g" $Files &> /dev/null
sed -i "s/name = Standard/name = Vanilla Standard/g" $Files &> /dev/null
done
sed -i "s/Vanilla Minimal/Vanilla Minimal\nold_short_name = testing/g" ./profiles/minimal/minimal.info
sed -i "s/Vanilla Standard/Vanilla Standard\nold_short_name = minimal/g" ./profiles/standard/standard.info
rm -f -r ./profiles/testing
}
#
# Rename D8 profiles.
rename_drupal8_profiles () {
for Files in `find ./core/profiles -type f`
do
sed -i "s/name = Minimal/name = Vanilla Minimal/g" $Files &> /dev/null
sed -i "s/name = Standard/name = Vanilla Standard/g" $Files &> /dev/null
done
sed -i "s/Vanilla Minimal/Vanilla Minimal\nold_short_name = testing/g" ./core/profiles/minimal/minimal.info
sed -i "s/Vanilla Standard/Vanilla Standard\nold_short_name = minimal/g" ./core/profiles/standard/standard.info
rm -f -r ./core/profiles/testing
}
#
# Prepare D6 core.
prepare_drupal6_core () {
if [ ! -e "$_D6_CORE_DIR" ] ; then
rm -f -r $_D6_CORE_DIR
cd /data/all/000/core
curl -s -A iCab "http://files.aegir.cc/dev/pressflow-$_SMALLCORE6.tar.gz" | tar -xzf -
cd $_D6_CORE_DIR/
fix_dirs_files
patch -p0 < /opt/tmp/$_BOA_REPO_NAME/aegir/patches/taxonomy-6.26.patch &> /dev/null
rm -f $_D6_CORE_DIR/modules/taxonomy/taxonomy.module.orig
rm -f modules/o_contrib
ln -s $_CORE/o_contrib modules/o_contrib
cp -af $_CORE/o_contrib/image/image.imagemagick.inc includes/
cp -af $_CORE/o_contrib/boost/stats/boost_stats.php ./ &> /dev/null
cd $_D6_CORE_DIR/themes
curl -s -A iCab "http://files.aegir.cc/dev/contrib/rubik-6.x-3.0-beta5.tar.gz" | tar -xzf -
curl -s -A iCab "http://files.aegir.cc/dev/contrib/tao-6.x-3.3.tar.gz" | tar -xzf -
rm -f $_D6_CORE_DIR/sites/all/*.txt
cd $_CORE
fi
}
#
# Prepare D7 core.
prepare_drupal7_core () {
if [ ! -e "$_D7_CORE_DIR" ] ; then
rm -f -r $_D7_CORE_DIR
cd /data/all/000/core
curl -s -A iCab "http://files.aegir.cc/dev/drupal-$_SMALLCORE7.tar.gz" | tar -xzf -
cd $_D7_CORE_DIR/
fix_dirs_files
rename_drupal7_profiles
patch -p0 < /opt/tmp/$_BOA_REPO_NAME/aegir/patches/taxonomy-7.12.patch &> /dev/null
rm -f $_D7_CORE_DIR/modules/taxonomy/taxonomy.module.orig
rm -f modules/o_contrib_seven
ln -s $_CORE/o_contrib_seven modules/o_contrib_seven
cd $_D7_CORE_DIR/themes
curl -s -A iCab "http://files.aegir.cc/dev/contrib/rubik-7.x-4.0-beta9.tar.gz" | tar -xzf -
curl -s -A iCab "http://files.aegir.cc/dev/contrib/tao-7.x-3.0-beta4.tar.gz" | tar -xzf -
cd $_CORE
fi
}
#
# Prepare D8 core.
prepare_drupal8_core () {
if [ ! -e "$_D8_CORE_DIR" ] ; then
rm -f -r $_D8_CORE_DIR
cd /data/all/000/core
curl -s -A iCab "http://files.aegir.cc/dev/drupal-$_SMALLCORE8.tar.gz" | tar -xzf -
cd $_D8_CORE_DIR/
fix_dirs_files
rename_drupal8_profiles
rm -f modules/o_contrib_eight
ln -s $_CORE/o_contrib_eight modules/o_contrib_eight
cd $_CORE
fi
}
#
# Remove D6 core from distro directory.
nocore_d6_dist_clean () {
rm -f $_SHRD_PLPATH/.gitignore
rm -f $_SHRD_PLPATH/.htaccess
rm -f $_SHRD_PLPATH/*.php
rm -f $_SHRD_PLPATH/*.txt
rm -f $_SHRD_PLPATH/*.xml
rm -f -r $_SHRD_PLPATH/cache
rm -f -r $_SHRD_PLPATH/includes
rm -f -r $_SHRD_PLPATH/misc
rm -f -r $_SHRD_PLPATH/modules
rm -f -r $_SHRD_PLPATH/sites
rm -f -r $_SHRD_PLPATH/scripts
rm -f -r $_SHRD_PLPATH/themes
if [ ! -d "$_SHRD_PLPATH/profiles" ] && [ -d "$_D6_CORE_DIR/profiles" ] ; then
rm -f -r $_SHRD_PLPATH/profiles
cp -af $_D6_CORE_DIR/profiles $_SHRD_PLPATH/
fi
sed -i "s/'dblog'/'robotstxt', 'path_alias_cache'/g" $_SHRD_PRPATH/$_REAL_PRNAME.profile &> /dev/null
}
#
# Remove D7 core from distro directory.
nocore_d7_dist_clean () {
rm -f $_SHRD_PLPATH/.gitignore
rm -f $_SHRD_PLPATH/.htaccess
rm -f $_SHRD_PLPATH/*.php
rm -f $_SHRD_PLPATH/*.txt
rm -f $_SHRD_PLPATH/*.xml
rm -f $_SHRD_PLPATH/web.config
rm -f -r $_SHRD_PLPATH/cache
rm -f -r $_SHRD_PLPATH/includes
rm -f -r $_SHRD_PLPATH/misc
rm -f -r $_SHRD_PLPATH/modules
rm -f -r $_SHRD_PLPATH/sites
rm -f -r $_SHRD_PLPATH/scripts
rm -f -r $_SHRD_PLPATH/themes
_REVISIONS="10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26"
for i in $_REVISIONS; do
if [ -d "$_CORE/drupal-7.$i" ] && [ ! -e "$_SHRD_PLPATH" ] ; then
mv $_CORE/drupal-7.$i $_SHRD_PLPATH
fi
done
if [ ! -d "$_SHRD_PLPATH/profiles" ] && [ -d "$_D7_CORE_DIR/profiles" ] ; then
rm -f -r $_SHRD_PLPATH/profiles
cp -af $_D7_CORE_DIR/profiles $_SHRD_PLPATH/
fi
}
#
# Remove D8 core from distro directory.
nocore_d8_dist_clean () {
rm -f $_SHRD_PLPATH/.gitignore
rm -f $_SHRD_PLPATH/.htaccess
rm -f $_SHRD_PLPATH/*.php
rm -f $_SHRD_PLPATH/*.txt
rm -f $_SHRD_PLPATH/*.xml
rm -f $_SHRD_PLPATH/web.config
rm -f -r $_SHRD_PLPATH/cache
rm -f -r $_SHRD_PLPATH/core
rm -f -r $_SHRD_PLPATH/includes
rm -f -r $_SHRD_PLPATH/misc
rm -f -r $_SHRD_PLPATH/modules
rm -f -r $_SHRD_PLPATH/scripts
rm -f -r $_SHRD_PLPATH/sites
rm -f -r $_SHRD_PLPATH/themes
if [ ! -d "$_SHRD_PLPATH/profiles" ] && [ -d "$_D8_CORE_DIR/profiles" ] ; then
rm -f -r $_SHRD_PLPATH/profiles
cp -af $_D8_CORE_DIR/profiles $_SHRD_PLPATH/
fi
}
#
# Enable D6 admin.
enable_drupal6_admin () {
sed -i "s/'path_alias_cache'/'path_alias_cache', 'admin'/g" $_SHRD_PRPATH/$_REAL_PRNAME.profile &> /dev/null
}
#
# Remove default core seven profiles.
remove_default_core_seven_profiles () {
rm -f -r $_SHRD_PLPATH/profiles/minimal
rm -f -r $_SHRD_PLPATH/profiles/standard
rm -f -r $_SHRD_PLPATH/profiles/testing
}
#
# Add old short name seven.
add_old_short_name_seven () {
sed -i "s/Drupal Minimal/Drupal Minimal\nold_short_name = testing/g" $_SHRD_PLPATH/profiles/minimal/minimal.info &> /dev/null
sed -i "s/Drupal Standard/Drupal Standard\nold_short_name = minimal/g" $_SHRD_PLPATH/profiles/standard/standard.info &> /dev/null
}
#
# Init this distro root.
init_this_distro_root () {
mkdir -p $_OCTO_PLPATH
cd $_OCTO_PLPATH
if [[ "$_SHRD_PLNAME" =~ "-$_SMALLCORE6" ]] ; then
create_d6_symlinks
elif [[ "$_SHRD_PLNAME" =~ "-$_SMALLCORE7" ]] ; then
create_d7_symlinks
else
create_d8_symlinks
fi
}
#
# Add old short name acquia.
add_old_short_name_acquia () {
sed -i "s/=> 'Pressflow',/=> 'Pressflow',\n 'old_short_name' => 'acquia',/g" $_SHRD_PRPATH/$_REAL_PRNAME.profile &> /dev/null
}
#
# Upgrade contrib less.
upgrade_contrib_less () {
rm -f -r {context,entity}
wget -q -U iCab http://files.aegir.cc/dev/contrib/context-7.x-3.1.tar.gz
wget -q -U iCab http://files.aegir.cc/dev/contrib/entity-7.x-1.2.tar.gz
for archive in ./*.tar.gz; do
tar -xzf "$archive" &> /dev/null
done
rm -f *.tar.gz
if [ -e "views" ] ; then
cd views
# http://drupal.org/node/1766338#comment-6445882
curl -s -O -A iCab http://files.aegir.cc/dev/patches/views-revert-broken-filter-or-groups-1766338-7.patch
patch -p1 < views-revert-broken-filter-or-groups-1766338-7.patch &> /dev/null
cd ../
fi
if [ -e "apps" ] ; then
cd apps
patch -p1 < /opt/tmp/$_BOA_REPO_NAME/aegir/patches/apps_msg.patch &> /dev/null
cd ../
fi
cd $_CORE
}
#
# Create D7 basic platform.
create_drupal7_basic () {
if [ ! -d "$_SHRD_PLPATH" ] ; then
mkdir -p $_SHRD_PLPATH
if [ ! -e "$_D7_CORE_DIR" ] ; then
prepare_drupal7_core
fi
nocore_d7_dist_clean
add_old_short_name_seven
fi
init_this_distro_root
}
###---### Checking status.
#
if [ -e "$_ROOT/log/setupmail.txt" ] ; then
_STATUS=UPGRADE
cd $_ROOT
fi
###---### User check.
#
msg "$_STATUS C: Aegir automated install script part C"
if [ `whoami` = "root" ] ; then
msg "$_STATUS C: FATAL ERROR: This script should be ran as a non-root user"
msg "$_STATUS C: FATAL ERROR: Aborting AegirSetupC installer NOW!"
touch /opt/tmp/status-AegirSetupC-FAIL
exit 1
fi
###---### Hot Sauce check.
#
if [ "$_HOT_SAUCE" = "NO" ] ; then
_CORE="/data/all/$_LAST_ALL"
_THIS_CORE="$_LAST_ALL"
if [ "$_USE_CURRENT" = "YES" ] && [ -e "/data/all/000/core-v-$_SMALLCORE6.txt" ] && [ -e "/data/all/000/core-v-$_SMALLCORE7.txt" ] ; then
msg "$_STATUS C: Shared platforms code v.$_LAST_ALL (latest available) will be used for this install"
elif [ "$_USE_CURRENT" = "NO" ] || [ ! -e "/data/all/000/core-v-$_SMALLCORE6.txt" ] || [ ! -e "/data/all/000/core-v-$_SMALLCORE7.txt" ] ; then
_CORE="/data/all/$_ALL_DISTRO"
_THIS_CORE="$_ALL_DISTRO"
msg "$_STATUS C: Shared platforms code v.$_ALL_DISTRO (hot new) will be created"
else
msg "$_STATUS C: Shared platforms code v.$_LAST_ALL (latest available) will be used for this install"
fi
else
_CORE="/data/all/$_ALL_DISTRO"
_THIS_CORE="$_ALL_DISTRO"
msg "$_STATUS C: Shared platforms code v.$_ALL_DISTRO (hot new) will be created"
fi
_D6_CORE_DIR="/data/all/000/core/pressflow-$_SMALLCORE6"
_D7_CORE_DIR="/data/all/000/core/drupal-$_SMALLCORE7"
_D8_CORE_DIR="/data/all/000/core/drupal-$_SMALLCORE8"
###---### Distributions full names.
#
_F_ACQUIA="Acquia $_SMALLCORE6 P.$_THIS_CORE"
_F_CIVICRM_M6="CiviCRM $_CIVICRM_M6 $_SMALLCORE6 P.$_THIS_CORE"
_F_CIVICRM_M7="CiviCRM $_CIVICRM_M7 $_SMALLCORE7 P.$_THIS_CORE"
_F_COD="Conference 1.0-a3 $_SMALLCORE7 P.$_THIS_CORE"
_F_COM_MERCE="Commerce 2.9 $_SMALLCORE7 P.$_THIS_CORE"
_F_COMMERCE="Commerce 1.20 $_SMALLCORE7 P.$_THIS_CORE"
_F_D6COMMONS="Commons 2.13 $_SMALLCORE6 P.$_THIS_CORE"
_F_D7COMMONS="Commons 3.4 $_SMALLCORE7 P.$_THIS_CORE"
_F_DRUPAL_EDGE_8="Drupal $_DRUPAL_EDGE_8"
_F_DRUPAL6="Drupal $_SMALLCORE6 P.$_THIS_CORE"
_F_DRUPAL7="Drupal $_SMALLCORE7 P.$_THIS_CORE"
_F_DRUPAL8="Drupal $_SMALLCORE8 P.$_THIS_CORE"
_F_FSERVER="Feature Server 1.2 $_SMALLCORE6 P.$_THIS_CORE"
_F_MANAGINGNEWS="MNews $_MANAGINGNEWS $_SMALLCORE6 P.$_THIS_CORE"
_F_NODESTREAM7="NodeStream 2.0-rc5 $_SMALLCORE7 P.$_THIS_CORE"
_F_OPENACADEMY="Open Academy 1.0-rc3 $_SMALLCORE7 P.$_THIS_CORE"
_F_OPENATRIUM6="Open Atrium 1.7.1 $_SMALLCORE6 P.$_THIS_CORE"
_F_OPENATRIUM7="Open Atrium 2.0 $_SMALLCORE7 P.$_THIS_CORE"
_F_OPENBLOG="OpenBlog 1.0-a2 $_SMALLCORE7 P.$_THIS_CORE"
_F_OPENCHURCH="OpenChurch 1.11-b13 $_SMALLCORE7 P.$_THIS_CORE"
_F_OPENDEALS="Open Deals $_OPEN_DEALS $_SMALLCORE7 P.$_THIS_CORE"
_F_OPENOUTREACH="Open Outreach 1.2 $_SMALLCORE7 P.$_THIS_CORE"
_F_OPENPUBLISH="OpenPublish 3.0-b7 $_SMALLCORE7 P.$_THIS_CORE"
_F_OPENSCHOLAR="OpenScholar 3.8.1 $_SMALLCORE7 P.$_THIS_CORE"
_F_PANOPOLY="Panopoly 1.0-rc5 $_SMALLCORE7 P.$_THIS_CORE"
_F_PROSEPOINT="Prosepoint $_PROSEPOINT $_SMALLCORE6 P.$_THIS_CORE"
_F_RECRUITER="Recruiter 1.1 $_SMALLCORE7 P.$_THIS_CORE"
_F_SPARK="Spark 1.0-a9 $_SMALLCORE7 P.$_THIS_CORE"
_F_TOTEM="Totem 1.1 $_SMALLCORE7 P.$_THIS_CORE"
_F_UBER_CART_SEVEN="Ubercart $_UBER_CART_SEVEN $_SMALLCORE7 P.$_THIS_CORE"
_F_UBERCART="Ubercart $_UBERCART $_SMALLCORE6 P.$_THIS_CORE"
#
_F_DRUPAL6_D="Drupal $_SMALLCORE6 D.$_THIS_CORE"
_F_DRUPAL6_S="Drupal $_SMALLCORE6 S.$_THIS_CORE"
_F_DRUPAL6_P="Drupal $_SMALLCORE6 P.$_THIS_CORE"
_F_DRUPAL7_D="Drupal $_SMALLCORE7 D.$_THIS_CORE"
_F_DRUPAL7_S="Drupal $_SMALLCORE7 S.$_THIS_CORE"
_F_DRUPAL7_P="Drupal $_SMALLCORE7 P.$_THIS_CORE"
###---### Create directories.
#
mkdir -p $_ROOT/distro/$_THIS_CORE
chmod 0711 $_ROOT/distro &> /dev/null
chmod 0711 $_ROOT/distro/$_THIS_CORE &> /dev/null
###---###
_ALLOW_ALL=YES
_ALLOW_CIVICRM=YES
if [ "$_CLIENT_CORES" -lt "1" ] ; then
_ALLOW_ALL=NO
_ALLOW_CIVICRM=NO
_D_8_ALLOW=NO
fi
if [[ "$_VM_TEST" =~ beng ]] ; then
_VMFAMILY="VS"
else
_VMFAMILY="XEN"
fi
if [[ "$_DOMAIN" =~ ".host8." ]] || [ "$_VMFAMILY" = "VS" ] ; then
_D_8_ALLOW=NO
fi
if [[ "$_DOMAIN" =~ "v182q.nyc." ]] || [[ "$_DOMAIN" =~ "ocean.nyc." ]] ; then
_D_8_ALLOW=YES
fi
acquia_install () {
###---### Acquia
#
_REAL_PRNAME="acquia"
_SHRD_PLNAME="$_REAL_PRNAME-$_SMALLCORE6"
_SHRD_PLPATH="$_CORE/$_SHRD_PLNAME"
_SHRD_PRPATH="$_SHRD_PLPATH/profiles/$_REAL_PRNAME"
_OCTO_PLPATH="$_ROOT/distro/$_THIS_CORE/$_SHRD_PLNAME"
if [ "$_PLATFORMS_LIST" = "ALL" ] || [[ $_PLATFORMS_LIST =~ AQ6 ]] ; then
if [ ! -d "$_OCTO_PLPATH/modules/path_alias_cache" ] ; then
echo " "
if prompt_yes_no "$_F_ACQUIA - http://bit.ly/acquiadrupal" ; then
true
msg "DISTRO: $_F_ACQUIA installation in progress..."
mrun "sleep 1"
if [ ! -d "$_SHRD_PLPATH" ] ; then
if [ "$_AEGIR_VERSION" = "HEAD" ] && [ "$_T_BUILD" = "HEAD" ] ; then
if [ ! -e "$_D6_CORE_DIR" ] ; then
prepare_drupal6_core
fi
cd $_CORE
get_distro_ext "vanilla-$_SHRD_PLNAME.tar.gz" &> /dev/null
nocore_d6_dist_clean
sed -i "s/=> 'Acquia Drupal',/=> 'Acquia Drupal',\n 'old_short_name' => 'default',/g" $_SHRD_PRPATH/$_REAL_PRNAME.profile &> /dev/null
rm -f -r $_SHRD_PLPATH/profiles/default
else
cd $_CORE
get_distro_ext "$_SHRD_PLNAME.tar.gz" &> /dev/null
fi
fi
init_this_distro_root
msg "DISTRO: $_F_ACQUIA installation completed"
mrun "sleep 1"
else
msg "DISTRO: $_F_ACQUIA installation skipped"
mrun "sleep 1"
fi
fi
fi
}
civicrm_m6_install () {
###---### CiviCRM Modern D6
#
_REAL_PRNAME="default"
_SHRD_PLNAME="civicrm-$_CIVICRM_M6-$_SMALLCORE6"
_SHRD_PLPATH="$_CORE/$_SHRD_PLNAME"
_SHRD_PRPATH="$_SHRD_PLPATH/profiles/$_REAL_PRNAME"
_OCTO_PLPATH="$_ROOT/distro/$_THIS_CORE/$_SHRD_PLNAME"
if [ "$_ALLOW_CIVICRM" = "YES" ] ; then
if [ "$_PLATFORMS_LIST" = "ALL" ] || [[ $_PLATFORMS_LIST =~ CM6 ]] ; then
if [ ! -d "$_OCTO_PLPATH/modules/path_alias_cache" ] ; then
echo " "
if prompt_yes_no "$_F_CIVICRM_M6 - http://civicrm.org" ; then
true
msg "DISTRO: $_F_CIVICRM_M6 installation in progress..."
mrun "sleep 1"
if [ ! -d "$_SHRD_PLPATH" ] ; then
if [ "$_AEGIR_VERSION" = "HEAD" ] && [ "$_T_BUILD" = "HEAD" ] ; then
if [ ! -e "$_D6_CORE_DIR" ] ; then
prepare_drupal6_core
fi
cd $_CORE
cp -af /opt/tmp/$_BOA_REPO_NAME/aegir/makefiles/civicrm-4.1-d6.make ./
$_DRUSHCMD make civicrm-4.1-d6.make $_SHRD_PLNAME &> /dev/null
rm -f civicrm-4.1-d6.make
_CIVI_ENGAGE="$_SHRD_PLPATH/sites/all/modules/civicrm/drupal/modules/civicrm_engage"
cp -af /opt/tmp/$_BOA_REPO_NAME/aegir/patches/civicrm_engage.install $_CIVI_ENGAGE/civicrm_engage.install &> /dev/null
if [ ! -d "$_SHRD_PLPATH/sites/all/modules/civicrm/l10n" ] && [ -d "$_SHRD_PLPATH/sites/all/modules/civicrm/civicrm_l10n/l10n" ] ; then
mv $_SHRD_PLPATH/sites/all/modules/civicrm/civicrm_l10n/l10n $_SHRD_PLPATH/sites/all/modules/civicrm/ &> /dev/null
fi
mkdir -p $_SHRD_PRPATH/modules
mv $_SHRD_PLPATH/sites/all/modules/civicrm $_SHRD_PRPATH/modules/ &> /dev/null
nocore_d6_dist_clean
add_old_short_name_acquia
else
cd $_CORE
get_distro_ext "$_SHRD_PLNAME.tar.gz" &> /dev/null
fi
fi
init_this_distro_root
msg "DISTRO: $_F_CIVICRM_M6 installation completed"
mrun "sleep 1"
else
msg "DISTRO: $_F_CIVICRM_M6 installation skipped"
mrun "sleep 1"
fi
fi
fi
fi
}
civicrm_m7_install () {
###---### CiviCRM Modern D7
#
_REAL_PRNAME="standard"
_SHRD_PLNAME="civicrm-$_CIVICRM_M7-$_SMALLCORE7"
_SHRD_PLPATH="$_CORE/$_SHRD_PLNAME"
_SHRD_PRPATH="$_SHRD_PLPATH/profiles/$_REAL_PRNAME"
_OCTO_PLPATH="$_ROOT/distro/$_THIS_CORE/$_SHRD_PLNAME"
if [ "$_ALLOW_CIVICRM" = "YES" ] ; then
if [ "$_PLATFORMS_LIST" = "ALL" ] || [[ $_PLATFORMS_LIST =~ CM7 ]] ; then
if [ ! -d "$_OCTO_PLPATH" ] ; then
echo " "
if prompt_yes_no "$_F_CIVICRM_M7 - http://civicrm.org" ; then
true
msg "DISTRO: $_F_CIVICRM_M7 installation in progress..."
mrun "sleep 1"
if [ ! -d "$_SHRD_PLPATH" ] ; then
cd $_CORE
if [ "$_AEGIR_VERSION" = "HEAD" ] && [ "$_T_BUILD" = "HEAD" ] ; then
if [ ! -e "$_D7_CORE_DIR" ] ; then
prepare_drupal7_core
fi
cp -af /opt/tmp/$_BOA_REPO_NAME/aegir/makefiles/civicrm-4.3-d7.make ./
$_DRUSHCMD make civicrm-4.3-d7.make $_SHRD_PLNAME &> /dev/null
rm -f civicrm-4.3-d7.make
if [ ! -d "$_SHRD_PLPATH/sites/all/modules/civicrm/l10n" ] && [ -d "$_SHRD_PLPATH/sites/all/modules/civicrm/civicrml10n/l10n" ] ; then
mv $_SHRD_PLPATH/sites/all/modules/civicrm/civicrml10n/l10n $_SHRD_PLPATH/sites/all/modules/civicrm/ &> /dev/null
fi
mkdir -p $_SHRD_PRPATH/modules
mv $_SHRD_PLPATH/sites/all/modules/civicrm $_SHRD_PRPATH/modules/ &> /dev/null
rm -f -r $_SHRD_PLPATH/profiles/testing
rm -f -r $_SHRD_PLPATH/profiles/minimal
nocore_d7_dist_clean
else
get_distro_ext "$_SHRD_PLNAME.tar.gz" &> /dev/null
fi
fi
init_this_distro_root
msg "DISTRO: $_F_CIVICRM_M7 installation completed"
mrun "sleep 1"
else
msg "DISTRO: $_F_CIVICRM_M7 installation skipped"
mrun "sleep 1"
fi
fi
fi
fi
}
cod_install () {
###---### Conference Organizing Distribution
#
_REAL_PRNAME="cod"
_SHRD_PLNAME="$_REAL_PRNAME-$_COD-$_SMALLCORE7"
_SHRD_PLPATH="$_CORE/$_SHRD_PLNAME"
_SHRD_PRPATH="$_SHRD_PLPATH/profiles/$_REAL_PRNAME"
_OCTO_PLPATH="$_ROOT/distro/$_THIS_CORE/$_SHRD_PLNAME"
if [ "$_ALLOW_ALL" = "YES" ] ; then
if [ "$_PLATFORMS_LIST" = "ALL" ] || [[ $_PLATFORMS_LIST =~ COD ]] ; then
if [ ! -d "$_OCTO_PLPATH" ] ; then
echo " "
if prompt_yes_no "$_F_COD - http://drupal.org/project/cod" ; then
true
msg "DISTRO: $_F_COD installation in progress..."
mrun "sleep 1"
if [ ! -d "$_SHRD_PLPATH" ] ; then
cd $_CORE
if [ "$_AEGIR_VERSION" = "HEAD" ] && [ "$_T_BUILD" = "HEAD" ] ; then
if [ ! -e "$_D7_CORE_DIR" ] ; then
prepare_drupal7_core
fi
curl -s -A iCab "http://ftp.drupal.org/files/projects/$_REAL_PRNAME-$_COD-core.tar.gz" | tar -xzf -
if [ -d "$_CORE/$_REAL_PRNAME-$_COD" ] ; then
mv $_REAL_PRNAME-$_COD $_SHRD_PLNAME
fi
nocore_d7_dist_clean
remove_default_core_seven_profiles
sed -i "s/Conference Organizing Distribution (COD)/Conference/g" $_SHRD_PRPATH/$_REAL_PRNAME.profile &> /dev/null
if [ $_COD = "7.x-1.0-alpha3" ] ; then
cd $_SHRD_PRPATH/modules/contrib
upgrade_contrib_less
fi
else
get_distro_ext "$_SHRD_PLNAME.tar.gz" &> /dev/null
fi
fi
init_this_distro_root
msg "DISTRO: $_F_COD installation completed"
mrun "sleep 1"
else
msg "DISTRO: $_F_COD installation skipped"
mrun "sleep 1"
fi
fi
fi
fi
}
commerce_7_1_install () {
###---### Commerce 7.x-1.x
#
_REAL_PRNAME="commerce_kickstart"
_SHRD_PLNAME="commerce-$_COMMERCE-$_SMALLCORE7"
_SHRD_PLPATH="$_CORE/$_SHRD_PLNAME"
_SHRD_PRPATH="$_SHRD_PLPATH/profiles/$_REAL_PRNAME"
_OCTO_PLPATH="$_ROOT/distro/$_THIS_CORE/$_SHRD_PLNAME"
if [ "$_ALLOW_ALL" = "YES" ] ; then
if [ "$_PLATFORMS_LIST" = "ALL" ] || [[ $_PLATFORMS_LIST =~ DCE ]] ; then
if [ ! -d "$_OCTO_PLPATH" ] ; then
echo " "
if prompt_yes_no "$_F_COMMERCE - http://drupalcommerce.org" ; then
true
msg "DISTRO: $_F_COMMERCE installation in progress..."
mrun "sleep 1"
if [ ! -d "$_SHRD_PLPATH" ] ; then
cd $_CORE
if [ "$_AEGIR_VERSION" = "HEAD" ] && [ "$_T_BUILD" = "HEAD" ] ; then
if [ ! -e "$_D7_CORE_DIR" ] ; then
prepare_drupal7_core
fi
curl -s -A iCab "http://ftp.drupal.org/files/projects/$_REAL_PRNAME-$_COMMERCE-core.tar.gz" | tar -xzf -
if [ -d "$_CORE/commerce-$_COMMERCE" ] ; then
mv commerce-$_COMMERCE $_SHRD_PLNAME
elif [ -d "$_CORE/$_REAL_PRNAME-$_COMMERCE" ] ; then
mv $_REAL_PRNAME-$_COMMERCE $_SHRD_PLNAME
fi
nocore_d7_dist_clean
remove_default_core_seven_profiles
cd $_SHRD_PRPATH
patch -p1 < /opt/tmp/$_BOA_REPO_NAME/aegir/patches/$_REAL_PRNAME.patch &> /dev/null
if [ $_COMMERCE = "7.x-1.20" ] ; then
cd $_SHRD_PRPATH/modules
rm -f -r {rules}
wget -q -U iCab http://files.aegir.cc/dev/contrib/rules-7.x-2.5.tar.gz
for archive in ./*.tar.gz; do
tar -xzf "$archive" &> /dev/null
done
rm -f *.tar.gz
upgrade_contrib_less
fi
else
get_distro_ext "$_SHRD_PLNAME.tar.gz" &> /dev/null
fi
fi
init_this_distro_root
msg "DISTRO: $_F_COMMERCE installation completed"
mrun "sleep 1"
else
msg "DISTRO: $_F_COMMERCE installation skipped"
mrun "sleep 1"
fi
fi
fi
fi
}
commerce_7_2_install () {
###---### Commerce 7.x-2.x
#
_REAL_PRNAME="commerce_kickstart"
_SHRD_PLNAME="commerce-$_COM_MERCE-$_SMALLCORE7"
_SHRD_PLPATH="$_CORE/$_SHRD_PLNAME"
_SHRD_PRPATH="$_SHRD_PLPATH/profiles/$_REAL_PRNAME"
_OCTO_PLPATH="$_ROOT/distro/$_THIS_CORE/$_SHRD_PLNAME"
if [ "$_ALLOW_ALL" = "YES" ] ; then
if [ "$_PLATFORMS_LIST" = "ALL" ] || [[ $_PLATFORMS_LIST =~ CME ]] ; then
if [ ! -d "$_OCTO_PLPATH" ] ; then
echo " "
if prompt_yes_no "$_F_COM_MERCE - http://drupalcommerce.org" ; then
true
msg "DISTRO: $_F_COM_MERCE installation in progress..."
mrun "sleep 1"
if [ ! -d "$_SHRD_PLPATH" ] ; then
cd $_CORE
if [ "$_AEGIR_VERSION" = "HEAD" ] && [ "$_T_BUILD" = "HEAD" ] ; then
if [ ! -e "$_D7_CORE_DIR" ] ; then
prepare_drupal7_core
fi
curl -s -A iCab "http://ftp.drupal.org/files/projects/$_REAL_PRNAME-$_COM_MERCE-core.tar.gz" | tar -xzf -
if [ -d "$_CORE/commerce-$_COM_MERCE" ] ; then
mv commerce-$_COM_MERCE $_SHRD_PLNAME
elif [ -d "$_CORE/$_REAL_PRNAME-$_COM_MERCE" ] ; then
mv $_REAL_PRNAME-$_COM_MERCE $_SHRD_PLNAME
fi
nocore_d7_dist_clean
remove_default_core_seven_profiles
cd $_SHRD_PRPATH
patch -p1 < /opt/tmp/$_BOA_REPO_NAME/aegir/patches/$_REAL_PRNAME.patch &> /dev/null
if [ $_COM_MERCE = "7.x-2.9" ] ; then
cd $_SHRD_PRPATH/modules/contrib
rm -f -r {message_notify}
wget -q -U iCab http://files.aegir.cc/dev/contrib/message_notify-7.x-2.5.tar.gz
for archive in ./*.tar.gz; do
tar -xzf "$archive" &> /dev/null
done
rm -f *.tar.gz
upgrade_contrib_less
fi
else
get_distro_ext "$_SHRD_PLNAME.tar.gz" &> /dev/null
fi
fi
init_this_distro_root
msg "DISTRO: $_F_COM_MERCE installation completed"
mrun "sleep 1"
else
msg "DISTRO: $_F_COM_MERCE installation skipped"
mrun "sleep 1"
fi
fi
fi
fi
}
commons_6_install () {
###---### Commons 6.x
#
_REAL_PRNAME="drupal_commons"
_SHRD_PLNAME="commons-$_D6COMMONS-$_SMALLCORE6"
_SHRD_PLPATH="$_CORE/$_SHRD_PLNAME"
_SHRD_PRPATH="$_SHRD_PLPATH/profiles/$_REAL_PRNAME"
_OCTO_PLPATH="$_ROOT/distro/$_THIS_CORE/$_SHRD_PLNAME"
if [ "$_ALLOW_ALL" = "YES" ] ; then
if [ "$_PLATFORMS_LIST" = "ALL" ] || [[ $_PLATFORMS_LIST =~ DCS ]] ; then
if [ ! -d "$_OCTO_PLPATH/modules/path_alias_cache" ] ; then
echo " "
if prompt_yes_no "$_F_D6COMMONS - http://acquia.com/drupalcommons" ; then
true
msg "DISTRO: $_F_D6COMMONS installation in progress..."
mrun "sleep 1"
if [ ! -d "$_SHRD_PLPATH" ] ; then
if [ "$_AEGIR_VERSION" = "HEAD" ] && [ "$_T_BUILD" = "HEAD" ] ; then
if [ ! -e "$_D6_CORE_DIR" ] ; then
prepare_drupal6_core
fi
cd $_CORE
get_distro_ext "commons-$_D6COMMONS.tar.gz" &> /dev/null
if [ -d "$_CORE/acquia_commons" ] ; then
mv $_CORE/acquia_commons $_SHRD_PLPATH
elif [ -d "$_CORE/commons-$_D6COMMONS" ] ; then
mv $_CORE/commons-$_D6COMMONS $_SHRD_PLPATH
else
mv $_CORE/commons $_SHRD_PLPATH
fi
if [ $_D6COMMONS = "6.x-2.13" ] ; then
cd $_SHRD_PRPATH/modules/contrib/og
patch -p1 < /opt/tmp/$_BOA_REPO_NAME/aegir/patches/og_update_6205_commons_fix.patch &> /dev/null
fi
rm -f -r $_SHRD_PLPATH/profiles/default
nocore_d6_dist_clean
sed -i "s/'Commons'/'Commons 2'/g" $_SHRD_PRPATH/$_REAL_PRNAME.profile &> /dev/null
else
cd $_CORE
get_distro_ext "$_SHRD_PLNAME.tar.gz" &> /dev/null
fi
fi
init_this_distro_root
if [ ! -L "$_OCTO_PLPATH/sites/all/libraries/getid3" ] ; then
mkdir -p $_OCTO_PLPATH/sites/all/libraries
ln -sf $_SHRD_PRPATH/libraries/getid3 $_OCTO_PLPATH/sites/all/libraries/getid3
fi
msg "DISTRO: $_F_D6COMMONS installation completed"
mrun "sleep 1"
else
msg "DISTRO: $_F_D6COMMONS installation skipped"