summaryrefslogtreecommitdiffstats
path: root/mkmodular
blob: 8a8ee1c195de9881e7fe2620ba0c29990634bffe (plain)
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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
#!/usr/bin/php
<?php
define('TOPDIR', '/home/rpmbuild/site/rpms');
chdir(TOPDIR);

$template_php = <<< EOT
---
document: modulemd
version: 2
data:
  name: php
  stream: remi-@VERSION@
  version: @DATE@
  context: 00000000
  arch: @ARCH@
  summary: PHP scripting language
  description: >-
    Alternative php @VERSION@ module.
    The remi-@VERSION@ stream provides more recent versions
    and more packages than default @VERSION@ stream.
  license:
    module:
    - GPLv2+
    content:
    - BSD
    - BSD and LGPLv3+
    - PHP
    - PHP and BSD
    - PHP and LGPLv2 and OpenLDAP
    - PHP and LGPLv2+
    - PHP and Zend and BSD and MIT and ASL 1.0
  dependencies:
  - buildrequires:
      platform: [@DIST@]
    requires:
@DEPS@
  references:
    documentation: http://php.net/
    tracker: https://bugs.php.net/
  profiles:
    common:
      rpms:
      - php-cli
      - php-common
      - php-fpm
      - php-mbstring
      - php-xml
    devel:
      rpms:
      - libzip
      - php-cli
      - php-common
      - php-devel
      - php-fpm
      - php-mbstring
      - php-pear
      - php-pecl-zip
      - php-process
      - php-xml
    minimal:
      rpms:
      - php-cli
      - php-common
  api:
    rpms:
    - php-fpm
  artifacts:
    rpms:
@RPMS@
...

EOT;

$template_phpextras = <<< EOT
---
document: modulemd
version: 2
data:
  name: php-extras
  stream: @VERSION@
  version: @DATE@
  context: 00000000
  arch: @ARCH@
  summary: PHP scripting language
  description: >-
    Additional package for php @VERSION@ module.
  license:
    module:
    - GPLv2+
    content:
    - BSD
    - BSD and LGPLv3+
    - PHP
    - PHP and BSD
    - PHP and LGPLv2 and OpenLDAP
    - PHP and LGPLv2+
    - PHP and Zend and BSD and MIT and ASL 1.0
  dependencies:
  - buildrequires:
      platform: [@DIST@]
    requires:
@DEPS@
  references:
    documentation: http://php.net/
    tracker: https://bugs.php.net/
  profiles:
    common:
      rpms:
      - php-sodium
  artifacts:
    rpms:
@RPMS@
...

EOT;

$template_redis = <<< EOT
---
document: modulemd
version: 2
data:
  name: redis
  stream: remi-@VERSION@
  version: @DATE@
  context: 00000000
  arch: @ARCH@
  summary: Redis persistent key-value database
  description: >-
    Alternative redis @VERSION@ module.
    The remi-@VERSION@ stream provides more recent versions
    and than default @VERSION@ stream.
  license:
    module:
    - GPLv2+
    content:
    - BSD and MIT
    - CC-BY-SA
  dependencies:
  - buildrequires:
      platform: [@DIST@]
    requires:
@DEPS@
  references:
    documentation: https://redis.io/documentation
    tracker: https://github.com/redis/redis/issues
  profiles:
    common:
      rpms:
      - redis
  api:
    rpms:
    - redis
  artifacts:
    rpms:
@RPMS@
...

EOT;

$template_memcached = <<< EOT
---
document: modulemd
version: 2
data:
  name: memcached
  stream: remi
  version: @DATE@
  context: 00000000
  arch: @ARCH@
  summary: High Performance, Distributed Memory Object Cache
  description: >-
    Alternative memcached module.
    The remi stream provides more recent versions
    and than default repository.
  license:
    module:
    - GPLv2+
    content:
    - BSD
  dependencies:
  - buildrequires:
      platform: [@DIST@]
    requires:
@DEPS@
  references:
    documentation: https://memcached.org/
    tracker: https://github.com/memcached/memcached/issues
  profiles:
    common:
      rpms:
      - memcached
      - memcached-selinux
  api:
    rpms:
    - memcached
  artifacts:
    rpms:
@RPMS@
...

EOT;

$template_comp = <<< EOT
---
document: modulemd
version: 2
data:
  name: composer
  stream: @VERSION@
  version: @DATE@
  context: 00000000
  arch: @ARCH@
  summary: Dependency Manager for PHP
  description: >-
    Composer @VERSION@ module
  license:
    module:
    - MIT
    content:
    - MIT
  dependencies:
  - buildrequires:
      platform: [@DIST@]
    requires:
@DEPS@
  references:
    documentation: https://getcomposer.org/
    tracker: https://github.com/composer/composer/issues
  profiles:
    common:
      rpms:
      - composer
  api:
    rpms:
    - composer
  artifacts:
    rpms:
@RPMS@
...

EOT;


function findPackages($from, $dest, $pat) {
	global $oldrpms;
	$excl = [
		'php-amqplib', 'php-jsonlint', 'php-cs-fixer', 'php-tecnickcom-tc-lib-unicode-data',
		'php-doctrine-orm', 'php-pear-phing', 'php-doctrine-collections', 'php-laminas-i18n', 'php-laminas-mail',
		'php-laminas-authentication', 'php-laminas-diactoros2', 'php-laminas-mime', 'php-laminas-i18n-resources',
		'php-laminas-memory', 'php-laminas-test', 'php-laminas-validator', 'php-laminas-view',
		'php-laminas-eventmanager', 'php-laminas-form3', 'php-laminas-config3', 'php-laminas-http', 'php-laminas-navigation',
		'php-laminas-psr7bridge',
		'php-laminas-inputfilter', 'php-laminas-crypt', 'php-laminas-di3', 'php-laminas-mvc-plugin-flashmessenger',
		'php-react-promise-timer', 'php-laminas-filter', 'php-laminas-router', 'php-react-http',
		'php-icewind-streams', 'php-masterminds-html5', 'php-league-mime-type-detection', 'php-monolog2',
	];
	$rpms = [];
	foreach (glob("$from/$pat") as $file) {
		$info = rpminfo($file);
		$name = basename($file);
		if (in_array($info['Name'], $excl)) {
			continue;
		}
		if (!file_exists("$dest/$name")) {
			if (link($file, "$dest/$name")) {
				$k = array_search(basename($file), $oldrpms);
				if ($k === false) {
					printf("\r\t+ %-70s\n", basename($file));
				} else {
					unset($oldrpms[$k]);
				}
			}
		}
		$rpms[] = 
			$info['Name'] . '-' . 
			($info['Epoch'] ?? '0') . ':' . 
			$info['Version'] . '-' . 
			$info['Release'] . '.' . 
			$info['Arch'];
	}
	return $rpms;
}

function genDefaults($name, $def, Array $vers) {
	$meta  =     "---\n" .
	             "document: modulemd-defaults\n" .
	             "version: 1\n" .
	             "data:\n" .
	             "  module: $name\n";
	if ($def) {
		$meta .= "  stream: \"$def\"\n";
	}
	$meta .=     "  profiles:\n";
	foreach ($vers as $ver) {
		$meta .= "    $ver: [common]\n";
	}
	$meta .=     "...\n";

	return $meta;
}
function genModule($srce, $dest, $pats, $ver, $arch, $deps, $template) {

	$rpms = [];
	foreach ((array)$pats as $pat) {
		$rpms += findPackages($srce, $dest, $pat);
	}
	$deptxt = '';
	foreach($deps as $n => $v) {
		$deptxt .= ($deptxt ? "\n" : '') . "      $n: [$v]";
	}
	if (empty($rpms)) {
		return '';
	}
	$rpmstxt = '';
	foreach($rpms as $rpm) {
		$rpmstxt .= ($rpmstxt ? "\n" : '') . "    - $rpm";
	}
	$mod = str_replace(
		['@VERSION@', '@ARCH@', "@DATE@",       "@DIST@",         "@DEPS@", '@RPMS@'],
		[$ver,        $arch,    date("YmdHis"), $deps['platform'], $deptxt, $rpmstxt],
		$template
	);
	return $mod;
}

function cleanup($dest) {
	global $oldrpms;

	$oldrpms = array();
	foreach (glob("$dest/*rpm") as $file) {
		unlink($file);
		$oldrpms[] = basename($file);
	}
}

function createRepo($dest, $mod) {
$old = getcwd();
chdir($dest);

// Key
[$dis,$ver]=explode("/", $dest);
$GPG_PATH="/home/remi/.gnupgrpm";
if ($dis == "fedora") {
	if ($ver >= 38) {
		$GPG_NAME="50A5E157DFE548EC7C05E9D8D5933DAB6DEFD35E";
	} else if ($ver >= 36) {
		$GPG_NAME="845160D23149DAD504F0A32D83C0639E1FEF0014";
	} else if ($ver >= 34) {
		$GPG_NAME="B1ABF71E14C9D74897E198A8B19527F1478F8947";
	} else if ($ver >= 32) {
		$GPG_NAME="34C10BDBCC6F1B252E50BA1A0714919E4C21A808";
	} else {
		$GPG_NAME="5F136145BF10369B7685D8DE503666CCBBAE6F1B";
	}
} else {
	if ($ver >= 9) {
		$GPG_NAME="B1ABF71E14C9D74897E198A8B19527F1478F8947";
	} else if ($ver == 8) {
		$GPG_NAME="6B38FEA7231F87F52B9CA9D8555097595F11735A";
	} else {
		$GPG_NAME="1EE04CCE88A4AE4AA29A5DF5004E6F4700F97F56";
	}
}
echo "Metadata, signing with $GPG_PATH, ";

// Repository content
exec("mkrepo nocheck noclean");

// Modular data
$data = '/tmp/modules.yaml';
file_put_contents($data, $mod);
$hash = hash('sha256', $mod);
exec("modifyrepo_c --mdtype=modules $data repodata >/dev/null");
$arch = basename($dest);
rename($data, "$data.$arch");

// Sign
@unlink("repodata/repomd.xml.asc");
exec("gpg --armor --detach-sign --default-key \"$GPG_NAME\" --homedir \"$GPG_PATH\" repodata/repomd.xml");
chdir($old);
}
/*
if (count($_SERVER['argv']) < 2 || in_array('f33', $_SERVER['argv'])) {
	$dest = 'fedora/33/modular/x86_64';
	echo "Populate $dest\n";
	cleanup($dest);
	$mod  = '';

	$deps = ['platform' => 'f33'];
	$mod .= genModule('fedora/33/remi/x86_64',   $dest, ['unit-php*rpm', 'php-*7.4*.rpm'], '7.4', 'x86_64', $deps, $template_php);
	$mod .= genModule('fedora/33/php80/x86_64',  $dest, '*.rpm',         '8.0', 'x86_64', $deps, $template_php);
	$mod .= genModule('fedora/33/php81/x86_64',  $dest, '*.rpm',         '8.1', 'x86_64', $deps, $template_php);
	$mod .= genDefaults('php', false, ['remi-7.4', 'remi-8.0', 'remi-8.1']);
	createRepo($dest, $mod);
}
if (in_array('f33', $_SERVER['argv']) || in_array('test', $_SERVER['argv'])) {
	$dest = 'fedora/33/modular-test/x86_64';
	echo "Populate $dest\n";
	cleanup($dest);
	$mod  = '';

	$deps = ['platform' => 'f33'];
	$mod .= genModule('fedora/33/test/x86_64',   $dest, ['unit-php*rpm', 'php-*7.4*.rpm'], '7.4', 'x86_64', $deps, $template_php);
	$mod .= genModule('fedora/33/test80/x86_64', $dest, '*.rpm',         '8.0', 'x86_64', $deps, $template_php);
	$mod .= genModule('fedora/33/test81/x86_64', $dest, '*.rpm',         '8.1', 'x86_64', $deps, $template_php);
	createRepo($dest, $mod);
}

if (count($_SERVER['argv']) < 2 || in_array('f34', $_SERVER['argv'])) {
	$dest = 'fedora/34/modular/x86_64';
	echo "Populate $dest\n";
	cleanup($dest);
	$mod  = '';

	$deps = ['platform' => 'f34'];
	$mod .= genModule('fedora/34/remi/x86_64',   $dest, ['uwsgi-plugin-php*rpm', 'unit-php*rpm', 'php-*7.4*.rpm'], '7.4', 'x86_64', $deps, $template_php);
	$mod .= genModule('fedora/34/php80/x86_64',  $dest, '*.rpm',         '8.0', 'x86_64', $deps, $template_php);
	$mod .= genModule('fedora/34/php81/x86_64',  $dest, '*.rpm',         '8.1', 'x86_64', $deps, $template_php);
	$mod .= genDefaults('php', false, ['remi-7.4', 'remi-8.0', 'remi-8.1']);
	createRepo($dest, $mod);

	$dest = 'fedora/34/debug-modular/x86_64';
	echo "Populate $dest\n";
	cleanup($dest);
	$mod  = '';

	$deps = ['platform' => 'f34'];
	$mod .= genModule('fedora/34/debug-remi/x86_64',   $dest, ['uwsgi-plugin-php*rpm', 'unit-php*rpm', 'php-*7.4*.rpm'], '7.4', 'x86_64', $deps, $template_php);
	$mod .= genModule('fedora/34/debug-php80/x86_64',  $dest, '*.rpm',         '8.0', 'x86_64', $deps, $template_php);
	$mod .= genModule('fedora/34/debug-php81/x86_64',  $dest, '*.rpm',         '8.1', 'x86_64', $deps, $template_php);
	createRepo($dest, $mod);
}
if (in_array('f34', $_SERVER['argv']) || in_array('test', $_SERVER['argv'])) {
	$dest = 'fedora/34/modular-test/x86_64';
	echo "Populate $dest\n";
	cleanup($dest);
	$mod  = '';

	$deps = ['platform' => 'f34'];
	$mod .= genModule('fedora/34/test/x86_64',   $dest, ['uwsgi-plugin-php*rpm', 'unit-php*rpm', 'php-*7.4*.rpm'], '7.4', 'x86_64', $deps, $template_php);
	$mod .= genModule('fedora/34/test80/x86_64', $dest, '*.rpm',         '8.0', 'x86_64', $deps, $template_php);
	$mod .= genModule('fedora/34/test81/x86_64', $dest, '*.rpm',         '8.1', 'x86_64', $deps, $template_php);
	createRepo($dest, $mod);

	$dest = 'fedora/34/debug-modular-test/x86_64';
	echo "Populate $dest\n";
	cleanup($dest);
	$mod  = '';

	$deps = ['platform' => 'f34'];
	$mod .= genModule('fedora/34/debug-test/x86_64',   $dest, ['uwsgi-plugin-php*rpm', 'unit-php*rpm', 'php-*7.4*.rpm'], '7.4', 'x86_64', $deps, $template_php);
	$mod .= genModule('fedora/34/debug-test80/x86_64', $dest, '*.rpm',         '8.0', 'x86_64', $deps, $template_php);
	$mod .= genModule('fedora/34/debug-test81/x86_64', $dest, '*.rpm',         '8.1', 'x86_64', $deps, $template_php);
	createRepo($dest, $mod);
}

if (count($_SERVER['argv']) < 2 || in_array('f35', $_SERVER['argv'])) {
	$dest = 'fedora/35/modular/x86_64';
	echo "Populate $dest\n";
	cleanup($dest);
	$mod  = '';

	$deps = ['platform' => 'f35'];
	$mod .= genModule('fedora/35/php74/x86_64',  $dest, '*rpm',          '7.4', 'x86_64', $deps, $template_php);
	$mod .= genModule('fedora/35/remi/x86_64',   $dest, ['uwsgi-plugin-php*rpm', 'unit-php*rpm', 'php-*8.0*.rpm'], '8.0', 'x86_64', $deps, $template_php);
	$mod .= genModule('fedora/35/php81/x86_64',  $dest, '*.rpm',         '8.1', 'x86_64', $deps, $template_php);
	$mod .= genModule('fedora/35/php82/x86_64',  $dest, '*.rpm',         '8.2', 'x86_64', $deps, $template_php);
	$mod .= genDefaults('php', false, ['remi-7.4', 'remi-8.0', 'remi-8.1', 'remi-8.2']);
	createRepo($dest, $mod);

	$dest = 'fedora/35/debug-modular/x86_64';
	echo "Populate $dest\n";
	cleanup($dest);
	$mod  = '';

	$deps = ['platform' => 'f35'];
	$mod .= genModule('fedora/35/debug-php74/x86_64',  $dest, '*.rpm',         '7.4', 'x86_64', $deps, $template_php);
	$mod .= genModule('fedora/35/debug-remi/x86_64',   $dest, ['uwsgi-plugin-php*rpm', 'unit-php*rpm', 'php-*8.0*.rpm'], '8.0', 'x86_64', $deps, $template_php);
	$mod .= genModule('fedora/35/debug-php81/x86_64',  $dest, '*.rpm',         '8.1', 'x86_64', $deps, $template_php);
	$mod .= genModule('fedora/35/debug-php82/x86_64',  $dest, '*.rpm',         '8.2', 'x86_64', $deps, $template_php);
	createRepo($dest, $mod);
}
if (in_array('f35', $_SERVER['argv']) || in_array('test', $_SERVER['argv'])) {
	$dest = 'fedora/35/modular-test/x86_64';
	echo "Populate $dest\n";
	cleanup($dest);
	$mod  = '';

	$deps = ['platform' => 'f35'];
	$mod .= genModule('fedora/35/test74/x86_64', $dest, '*.rpm',         '7.4', 'x86_64', $deps, $template_php);
	$mod .= genModule('fedora/35/test/x86_64',   $dest, ['uwsgi-plugin-php*rpm', 'unit-php*rpm', 'php-*8.0*.rpm'], '8.0', 'x86_64', $deps, $template_php);
	$mod .= genModule('fedora/35/test81/x86_64', $dest, '*.rpm',         '8.1', 'x86_64', $deps, $template_php);
	$mod .= genModule('fedora/35/test82/x86_64', $dest, '*.rpm',         '8.2', 'x86_64', $deps, $template_php);
	createRepo($dest, $mod);

	$dest = 'fedora/35/debug-modular-test/x86_64';
	echo "Populate $dest\n";
	cleanup($dest);
	$mod  = '';

	$deps = ['platform' => 'f35'];
	$mod .= genModule('fedora/35/debug-test74/x86_64', $dest, '*.rpm',         '7.4', 'x86_64', $deps, $template_php);
	$mod .= genModule('fedora/35/debug-test/x86_64',   $dest, ['uwsgi-plugin-php*rpm', 'unit-php*rpm', 'php-*8.0*.rpm'], '8.0', 'x86_64', $deps, $template_php);
	$mod .= genModule('fedora/35/debug-test81/x86_64', $dest, '*.rpm',         '8.1', 'x86_64', $deps, $template_php);
	$mod .= genModule('fedora/35/debug-test82/x86_64', $dest, '*.rpm',         '8.2', 'x86_64', $deps, $template_php);
	createRepo($dest, $mod);
}

if (count($_SERVER['argv']) < 2 || in_array('f36', $_SERVER['argv'])) {
	$dest = 'fedora/36/modular/x86_64';
	echo "Populate $dest\n";
	cleanup($dest);
	$mod  = '';

	$deps = ['platform' => 'f36'];
	$mod .= genModule('fedora/36/php74/x86_64',  $dest, '*.rpm', '7.4', 'x86_64', $deps, $template_php);
	$mod .= genModule('fedora/36/php80/x86_64',  $dest, '*.rpm', '8.0', 'x86_64', $deps, $template_php);
	$mod .= genModule('fedora/36/php81/x86_64',  $dest, '*.rpm', '8.1', 'x86_64', $deps, $template_php);
	$mod .= genModule('fedora/36/php82/x86_64',  $dest, '*.rpm', '8.2', 'x86_64', $deps, $template_php);
	$mod .= genDefaults('php', false, ['remi-7.4', 'remi-8.0', 'remi-8.1', 'remi-8.2']);
	$mod .= genModule('fedora/36/redis60/x86_64',$dest, '*.rpm', '6.0', 'x86_64', $deps, $template_redis);
	$mod .= genModule('fedora/36/redis62/x86_64',$dest, '*.rpm', '6.2', 'x86_64', $deps, $template_redis);
	$mod .= genModule('fedora/36/redis70/x86_64',$dest, '*.rpm', '7.0', 'x86_64', $deps, $template_redis);
	$mod .= genModule('fedora/36/redis72/x86_64',$dest, '*.rpm', '7.2', 'x86_64', $deps, $template_redis);
	$mod .= genDefaults('redis', false, ['remi-6.0', 'remi-6.2', 'remi-7.0', 'remi-7.2']);
	$mod .= genModule('fedora/36/memcached/x86_64',$dest, '*.rpm', false, 'x86_64', $deps, $template_memcached);
	$mod .= genDefaults('memcached', false, ['remi']);
	createRepo($dest, $mod);

	$dest = 'fedora/36/debug-modular/x86_64';
	echo "Populate $dest\n";
	cleanup($dest);
	$mod  = '';

	$deps = ['platform' => 'f36'];
	$mod .= genModule('fedora/36/debug-php74/x86_64',  $dest, '*.rpm', '7.4', 'x86_64', $deps, $template_php);
	$mod .= genModule('fedora/36/debug-php80/x86_64',  $dest, '*.rpm', '8.0', 'x86_64', $deps, $template_php);
	$mod .= genModule('fedora/36/debug-php81/x86_64',  $dest, '*.rpm', '8.1', 'x86_64', $deps, $template_php);
	$mod .= genModule('fedora/36/debug-php82/x86_64',  $dest, '*.rpm', '8.2', 'x86_64', $deps, $template_php);
	$mod .= genModule('fedora/36/debug-redis60/x86_64',$dest, '*.rpm', '6.0', 'x86_64', $deps, $template_redis);
	$mod .= genModule('fedora/36/debug-redis62/x86_64',$dest, '*.rpm', '6.2', 'x86_64', $deps, $template_redis);
	$mod .= genModule('fedora/36/debug-redis70/x86_64',$dest, '*.rpm', '7.0', 'x86_64', $deps, $template_redis);
	$mod .= genModule('fedora/36/debug-redis72/x86_64',$dest, '*.rpm', '7.2', 'x86_64', $deps, $template_redis);
	$mod .= genModule('fedora/36/debug-memcached/x86_64',$dest, '*.rpm', false, 'x86_64', $deps, $template_memcached);
	createRepo($dest, $mod);
}
if (in_array('f36', $_SERVER['argv']) || in_array('test', $_SERVER['argv'])) {
	$dest = 'fedora/36/modular-test/x86_64';
	echo "Populate $dest\n";
	cleanup($dest);
	$mod  = '';

	$deps = ['platform' => 'f36'];
	$mod .= genModule('fedora/36/test74/x86_64', $dest, '*.rpm', '7.4', 'x86_64', $deps, $template_php);
	$mod .= genModule('fedora/36/test80/x86_64', $dest, '*.rpm', '8.0', 'x86_64', $deps, $template_php);
	$mod .= genModule('fedora/36/test81/x86_64', $dest, '*.rpm', '8.1', 'x86_64', $deps, $template_php);
	$mod .= genModule('fedora/36/test82/x86_64', $dest, '*.rpm', '8.2', 'x86_64', $deps, $template_php);
	createRepo($dest, $mod);

	$dest = 'fedora/36/debug-modular-test/x86_64';
	echo "Populate $dest\n";
	cleanup($dest);
	$mod  = '';

	$deps = ['platform' => 'f36'];
	$mod .= genModule('fedora/36/debug-test74/x86_64', $dest, '*.rpm', '7.4', 'x86_64', $deps, $template_php);
	$mod .= genModule('fedora/36/debug-test80/x86_64', $dest, '*.rpm', '8.0', 'x86_64', $deps, $template_php);
	$mod .= genModule('fedora/36/debug-test81/x86_64', $dest, '*.rpm', '8.1', 'x86_64', $deps, $template_php);
	$mod .= genModule('fedora/36/debug-test82/x86_64', $dest, '*.rpm', '8.2', 'x86_64', $deps, $template_php);
	createRepo($dest, $mod);
}
*/

if (count($_SERVER['argv']) < 2 || in_array('f37', $_SERVER['argv'])) {
	$dest = 'fedora/37/modular/x86_64';
	echo "Populate $dest\n";
	cleanup($dest);
	$mod  = '';

	$deps = ['platform' => 'f37'];
	$mod .= genModule('fedora/37/php74/x86_64',  $dest, '*.rpm', '7.4', 'x86_64', $deps, $template_php);
	$mod .= genModule('fedora/37/php80/x86_64',  $dest, '*.rpm', '8.0', 'x86_64', $deps, $template_php);
	$mod .= genModule('fedora/37/php81/x86_64',  $dest, '*.rpm', '8.1', 'x86_64', $deps, $template_php);
	$mod .= genModule('fedora/37/php82/x86_64',  $dest, '*.rpm', '8.2', 'x86_64', $deps, $template_php);
	$mod .= genModule('fedora/37/php83/x86_64',  $dest, '*.rpm', '8.3', 'x86_64', $deps, $template_php);
	$mod .= genDefaults('php', false, ['remi-7.4', 'remi-8.0', 'remi-8.1', 'remi-8.2', 'remi-8.3']);
	$mod .= genModule('fedora/37/redis60/x86_64',$dest, '*.rpm', '6.0', 'x86_64', $deps, $template_redis);
	$mod .= genModule('fedora/37/redis62/x86_64',$dest, '*.rpm', '6.2', 'x86_64', $deps, $template_redis);
	$mod .= genModule('fedora/37/redis70/x86_64',$dest, '*.rpm', '7.0', 'x86_64', $deps, $template_redis);
	$mod .= genModule('fedora/37/redis72/x86_64',$dest, '*.rpm', '7.2', 'x86_64', $deps, $template_redis);
	$mod .= genDefaults('redis', false, ['remi-6.0', 'remi-6.2', 'remi-7.0', 'remi-7.2']);
	$mod .= genModule('fedora/37/memcached/x86_64',$dest, '*.rpm', false, 'x86_64', $deps, $template_memcached);
	$mod .= genDefaults('memcached', false, ['remi']);
	createRepo($dest, $mod);

	$dest = 'fedora/37/debug-modular/x86_64';
	echo "Populate $dest\n";
	cleanup($dest);
	$mod  = '';

	$deps = ['platform' => 'f37'];
	$mod .= genModule('fedora/37/debug-php74/x86_64',  $dest, '*.rpm', '7.4', 'x86_64', $deps, $template_php);
	$mod .= genModule('fedora/37/debug-php80/x86_64',  $dest, '*.rpm', '8.0', 'x86_64', $deps, $template_php);
	$mod .= genModule('fedora/37/debug-php81/x86_64',  $dest, '*.rpm', '8.1', 'x86_64', $deps, $template_php);
	$mod .= genModule('fedora/37/debug-php82/x86_64',  $dest, '*.rpm', '8.2', 'x86_64', $deps, $template_php);
	$mod .= genModule('fedora/37/debug-php83/x86_64',  $dest, '*.rpm', '8.3', 'x86_64', $deps, $template_php);
	$mod .= genModule('fedora/37/debug-redis60/x86_64',$dest, '*.rpm', '6.0', 'x86_64', $deps, $template_redis);
	$mod .= genModule('fedora/37/debug-redis62/x86_64',$dest, '*.rpm', '6.2', 'x86_64', $deps, $template_redis);
	$mod .= genModule('fedora/37/debug-redis70/x86_64',$dest, '*.rpm', '7.0', 'x86_64', $deps, $template_redis);
	$mod .= genModule('fedora/37/debug-redis72/x86_64',$dest, '*.rpm', '7.2', 'x86_64', $deps, $template_redis);
	$mod .= genModule('fedora/37/debug-memcached/x86_64',$dest, '*.rpm', false, 'x86_64', $deps, $template_memcached);
	createRepo($dest, $mod);
}
if (in_array('f37', $_SERVER['argv']) || in_array('test', $_SERVER['argv'])) {
	$dest = 'fedora/37/modular-test/x86_64';
	echo "Populate $dest\n";
	cleanup($dest);
	$mod  = '';

	$deps = ['platform' => 'f37'];
	$mod .= genModule('fedora/37/test74/x86_64', $dest, '*.rpm', '7.4', 'x86_64', $deps, $template_php);
	$mod .= genModule('fedora/37/test80/x86_64', $dest, '*.rpm', '8.0', 'x86_64', $deps, $template_php);
	$mod .= genModule('fedora/37/test81/x86_64', $dest, '*.rpm', '8.1', 'x86_64', $deps, $template_php);
	$mod .= genModule('fedora/37/test82/x86_64', $dest, '*.rpm', '8.2', 'x86_64', $deps, $template_php);
	$mod .= genModule('fedora/37/test83/x86_64', $dest, '*.rpm', '8.3', 'x86_64', $deps, $template_php);
	createRepo($dest, $mod);

	$dest = 'fedora/37/debug-modular-test/x86_64';
	echo "Populate $dest\n";
	cleanup($dest);
	$mod  = '';

	$deps = ['platform' => 'f37'];
	$mod .= genModule('fedora/37/debug-test74/x86_64', $dest, '*.rpm', '7.4', 'x86_64', $deps, $template_php);
	$mod .= genModule('fedora/37/debug-test80/x86_64', $dest, '*.rpm', '8.0', 'x86_64', $deps, $template_php);
	$mod .= genModule('fedora/37/debug-test81/x86_64', $dest, '*.rpm', '8.1', 'x86_64', $deps, $template_php);
	$mod .= genModule('fedora/37/debug-test82/x86_64', $dest, '*.rpm', '8.2', 'x86_64', $deps, $template_php);
	$mod .= genModule('fedora/37/debug-test83/x86_64', $dest, '*.rpm', '8.3', 'x86_64', $deps, $template_php);
	createRepo($dest, $mod);
}

if (count($_SERVER['argv']) < 2 || in_array('f38', $_SERVER['argv'])) {
	$dest = 'fedora/38/modular/x86_64';
	echo "Populate $dest\n";
	cleanup($dest);
	$mod  = '';

	$deps = ['platform' => 'f38'];
	$mod .= genModule('fedora/38/php74/x86_64',  $dest, '*.rpm', '7.4', 'x86_64', $deps, $template_php);
	$mod .= genModule('fedora/38/php80/x86_64',  $dest, '*.rpm', '8.0', 'x86_64', $deps, $template_php);
	$mod .= genModule('fedora/38/php81/x86_64',  $dest, '*.rpm', '8.1', 'x86_64', $deps, $template_php);
	$mod .= genModule('fedora/38/php82/x86_64',  $dest, '*.rpm', '8.2', 'x86_64', $deps, $template_php);
	$mod .= genModule('fedora/38/php83/x86_64',  $dest, '*.rpm', '8.3', 'x86_64', $deps, $template_php);
	$mod .= genDefaults('php', false, ['remi-7.4', 'remi-8.0', 'remi-8.1', 'remi-8.2', 'remi-8.3']);
	$mod .= genModule('fedora/38/redis60/x86_64',$dest, '*.rpm', '6.0', 'x86_64', $deps, $template_redis);
	$mod .= genModule('fedora/38/redis62/x86_64',$dest, '*.rpm', '6.2', 'x86_64', $deps, $template_redis);
	$mod .= genModule('fedora/38/redis70/x86_64',$dest, '*.rpm', '7.0', 'x86_64', $deps, $template_redis);
	$mod .= genModule('fedora/38/redis72/x86_64',$dest, '*.rpm', '7.2', 'x86_64', $deps, $template_redis);
	$mod .= genDefaults('redis', false, ['remi-6.0', 'remi-6.2', 'remi-7.0', 'remi-7.2']);
	$mod .= genModule('fedora/38/memcached/x86_64',$dest, '*.rpm', false, 'x86_64', $deps, $template_memcached);
	$mod .= genDefaults('memcached', false, ['remi']);
	createRepo($dest, $mod);

	$dest = 'fedora/38/debug-modular/x86_64';
	echo "Populate $dest\n";
	cleanup($dest);
	$mod  = '';

	$deps = ['platform' => 'f38'];
	$mod .= genModule('fedora/38/debug-php74/x86_64',  $dest, '*.rpm', '7.4', 'x86_64', $deps, $template_php);
	$mod .= genModule('fedora/38/debug-php80/x86_64',  $dest, '*.rpm', '8.0', 'x86_64', $deps, $template_php);
	$mod .= genModule('fedora/38/debug-php81/x86_64',  $dest, '*.rpm', '8.1', 'x86_64', $deps, $template_php);
	$mod .= genModule('fedora/38/debug-php82/x86_64',  $dest, '*.rpm', '8.2', 'x86_64', $deps, $template_php);
	$mod .= genModule('fedora/38/debug-php83/x86_64',  $dest, '*.rpm', '8.3', 'x86_64', $deps, $template_php);
	$mod .= genModule('fedora/38/debug-redis60/x86_64',$dest, '*.rpm', '6.0', 'x86_64', $deps, $template_redis);
	$mod .= genModule('fedora/38/debug-redis62/x86_64',$dest, '*.rpm', '6.2', 'x86_64', $deps, $template_redis);
	$mod .= genModule('fedora/38/debug-redis70/x86_64',$dest, '*.rpm', '7.0', 'x86_64', $deps, $template_redis);
	$mod .= genModule('fedora/38/debug-redis72/x86_64',$dest, '*.rpm', '7.2', 'x86_64', $deps, $template_redis);
	$mod .= genModule('fedora/38/debug-memcached/x86_64',$dest, '*.rpm', false, 'x86_64', $deps, $template_memcached);
	createRepo($dest, $mod);
}
if (in_array('f38', $_SERVER['argv']) || in_array('test', $_SERVER['argv'])) {
	$dest = 'fedora/38/modular-test/x86_64';
	echo "Populate $dest\n";
	cleanup($dest);
	$mod  = '';

	$deps = ['platform' => 'f38'];
	$mod .= genModule('fedora/38/test74/x86_64', $dest, '*.rpm', '7.4', 'x86_64', $deps, $template_php);
	$mod .= genModule('fedora/38/test80/x86_64', $dest, '*.rpm', '8.0', 'x86_64', $deps, $template_php);
	$mod .= genModule('fedora/38/test81/x86_64', $dest, '*.rpm', '8.1', 'x86_64', $deps, $template_php);
	$mod .= genModule('fedora/38/test82/x86_64', $dest, '*.rpm', '8.2', 'x86_64', $deps, $template_php);
	$mod .= genModule('fedora/38/test83/x86_64', $dest, '*.rpm', '8.3', 'x86_64', $deps, $template_php);
	createRepo($dest, $mod);

	$dest = 'fedora/38/debug-modular-test/x86_64';
	echo "Populate $dest\n";
	cleanup($dest);
	$mod  = '';

	$deps = ['platform' => 'f38'];
	$mod .= genModule('fedora/38/debug-test74/x86_64', $dest, '*.rpm', '7.4', 'x86_64', $deps, $template_php);
	$mod .= genModule('fedora/38/debug-test80/x86_64', $dest, '*.rpm', '8.0', 'x86_64', $deps, $template_php);
	$mod .= genModule('fedora/38/debug-test81/x86_64', $dest, '*.rpm', '8.1', 'x86_64', $deps, $template_php);
	$mod .= genModule('fedora/38/debug-test82/x86_64', $dest, '*.rpm', '8.2', 'x86_64', $deps, $template_php);
	$mod .= genModule('fedora/38/debug-test83/x86_64', $dest, '*.rpm', '8.3', 'x86_64', $deps, $template_php);
	createRepo($dest, $mod);
}

if (count($_SERVER['argv']) < 2 || in_array('f39', $_SERVER['argv'])) {
	$dest = 'fedora/39/modular/x86_64';
	echo "Populate $dest\n";
	cleanup($dest);
	$mod  = '';

	$deps = ['platform' => 'f39'];
	$mod .= genModule('fedora/39/php74/x86_64',  $dest, '*.rpm', '7.4', 'x86_64', $deps, $template_php);
	$mod .= genModule('fedora/39/php80/x86_64',  $dest, '*.rpm', '8.0', 'x86_64', $deps, $template_php);
	$mod .= genModule('fedora/39/php81/x86_64',  $dest, '*.rpm', '8.1', 'x86_64', $deps, $template_php);
	$mod .= genModule('fedora/39/php82/x86_64',  $dest, '*.rpm', '8.2', 'x86_64', $deps, $template_php);
	$mod .= genModule('fedora/39/php83/x86_64',  $dest, '*.rpm', '8.3', 'x86_64', $deps, $template_php);
	$mod .= genDefaults('php', false, ['remi-7.4', 'remi-8.0', 'remi-8.1', 'remi-8.2', 'remi-8.3']);
	$mod .= genModule('fedora/39/redis60/x86_64',$dest, '*.rpm', '6.0', 'x86_64', $deps, $template_redis);
	$mod .= genModule('fedora/39/redis62/x86_64',$dest, '*.rpm', '6.2', 'x86_64', $deps, $template_redis);
	$mod .= genModule('fedora/39/redis70/x86_64',$dest, '*.rpm', '7.0', 'x86_64', $deps, $template_redis);
	$mod .= genModule('fedora/39/redis72/x86_64',$dest, '*.rpm', '7.2', 'x86_64', $deps, $template_redis);
	$mod .= genDefaults('redis', false, ['remi-6.0', 'remi-6.2', 'remi-7.0', 'remi-7.2']);
	$mod .= genModule('fedora/39/memcached/x86_64',$dest, '*.rpm', false, 'x86_64', $deps, $template_memcached);
	$mod .= genDefaults('memcached', false, ['remi']);
	createRepo($dest, $mod);

	$dest = 'fedora/39/debug-modular/x86_64';
	echo "Populate $dest\n";
	cleanup($dest);
	$mod  = '';

	$deps = ['platform' => 'f39'];
	$mod .= genModule('fedora/39/debug-php74/x86_64',  $dest, '*.rpm', '7.4', 'x86_64', $deps, $template_php);
	$mod .= genModule('fedora/39/debug-php80/x86_64',  $dest, '*.rpm', '8.0', 'x86_64', $deps, $template_php);
	$mod .= genModule('fedora/39/debug-php81/x86_64',  $dest, '*.rpm', '8.1', 'x86_64', $deps, $template_php);
	$mod .= genModule('fedora/39/debug-php82/x86_64',  $dest, '*.rpm', '8.2', 'x86_64', $deps, $template_php);
	$mod .= genModule('fedora/39/debug-php83/x86_64',  $dest, '*.rpm', '8.3', 'x86_64', $deps, $template_php);
	$mod .= genModule('fedora/39/debug-redis60/x86_64',$dest, '*.rpm', '6.0', 'x86_64', $deps, $template_redis);
	$mod .= genModule('fedora/39/debug-redis62/x86_64',$dest, '*.rpm', '6.2', 'x86_64', $deps, $template_redis);
	$mod .= genModule('fedora/39/debug-redis70/x86_64',$dest, '*.rpm', '7.0', 'x86_64', $deps, $template_redis);
	$mod .= genModule('fedora/39/debug-redis72/x86_64',$dest, '*.rpm', '7.2', 'x86_64', $deps, $template_redis);
	$mod .= genModule('fedora/39/debug-memcached/x86_64',$dest, '*.rpm', false, 'x86_64', $deps, $template_memcached);
	createRepo($dest, $mod);
}
if (in_array('f39', $_SERVER['argv']) || in_array('test', $_SERVER['argv'])) {
	$dest = 'fedora/39/modular-test/x86_64';
	echo "Populate $dest\n";
	cleanup($dest);
	$mod  = '';

	$deps = ['platform' => 'f39'];
	$mod .= genModule('fedora/39/test74/x86_64', $dest, '*.rpm', '7.4', 'x86_64', $deps, $template_php);
	$mod .= genModule('fedora/39/test80/x86_64', $dest, '*.rpm', '8.0', 'x86_64', $deps, $template_php);
	$mod .= genModule('fedora/39/test81/x86_64', $dest, '*.rpm', '8.1', 'x86_64', $deps, $template_php);
	$mod .= genModule('fedora/39/test82/x86_64', $dest, '*.rpm', '8.2', 'x86_64', $deps, $template_php);
	$mod .= genModule('fedora/39/test83/x86_64', $dest, '*.rpm', '8.3', 'x86_64', $deps, $template_php);
	createRepo($dest, $mod);

	$dest = 'fedora/39/debug-modular-test/x86_64';
	echo "Populate $dest\n";
	cleanup($dest);
	$mod  = '';

	$deps = ['platform' => 'f39'];
	$mod .= genModule('fedora/39/debug-test74/x86_64', $dest, '*.rpm', '7.4', 'x86_64', $deps, $template_php);
	$mod .= genModule('fedora/39/debug-test80/x86_64', $dest, '*.rpm', '8.0', 'x86_64', $deps, $template_php);
	$mod .= genModule('fedora/39/debug-test81/x86_64', $dest, '*.rpm', '8.1', 'x86_64', $deps, $template_php);
	$mod .= genModule('fedora/39/debug-test82/x86_64', $dest, '*.rpm', '8.2', 'x86_64', $deps, $template_php);
	$mod .= genModule('fedora/39/debug-test83/x86_64', $dest, '*.rpm', '8.3', 'x86_64', $deps, $template_php);
	createRepo($dest, $mod);
}

if (in_array('el8', $_SERVER['argv']) || in_array('el8x', $_SERVER['argv']) || in_array('test', $_SERVER['argv'])) {
	$dest = 'enterprise/8/modular-test/x86_64';
	echo "Populate $dest\n";
	cleanup($dest);
	$mod  = '';

	$deps = ['platform' => 'el8'];
	$mod .= genModule('enterprise/8/test72/x86_64',  $dest, '*.rpm',         '7.2', 'x86_64', $deps, $template_php);
	$mod .= genModule('enterprise/8/test73/x86_64',  $dest, '*.rpm',         '7.3', 'x86_64', $deps, $template_php);
	$mod .= genModule('enterprise/8/test74/x86_64',  $dest, '*.rpm',         '7.4', 'x86_64', $deps, $template_php);
	$mod .= genModule('enterprise/8/test80/x86_64',  $dest, '*.rpm',         '8.0', 'x86_64', $deps, $template_php);
	$mod .= genModule('enterprise/8/test81/x86_64',  $dest, '*.rpm',         '8.1', 'x86_64', $deps, $template_php);
	$mod .= genModule('enterprise/8/test82/x86_64',  $dest, '*.rpm',         '8.2', 'x86_64', $deps, $template_php);
	$mod .= genModule('enterprise/8/test83/x86_64',  $dest, '*.rpm',         '8.3', 'x86_64', $deps, $template_php);

	$deps = ['platform' => 'el8', 'php' => ''];
	$mod .= genModule('enterprise/8/composer2-test/x86_64', $dest, '*.rpm',   '2', 'x86_64', $deps, $template_comp);
	createRepo($dest, $mod);

	$dest = 'enterprise/8/debug-modular-test/x86_64';
	echo "Populate $dest\n";
	cleanup($dest);
	$mod  = '';

	$deps = ['platform' => 'el8'];
	$mod .= genModule('enterprise/8/debug-test72/x86_64',  $dest, '*.rpm',         '7.2', 'x86_64', $deps, $template_php);
	$mod .= genModule('enterprise/8/debug-test73/x86_64',  $dest, '*.rpm',         '7.3', 'x86_64', $deps, $template_php);
	$mod .= genModule('enterprise/8/debug-test74/x86_64',  $dest, '*.rpm',         '7.4', 'x86_64', $deps, $template_php);
	$mod .= genModule('enterprise/8/debug-test80/x86_64',  $dest, '*.rpm',         '8.0', 'x86_64', $deps, $template_php);
	$mod .= genModule('enterprise/8/debug-test81/x86_64',  $dest, '*.rpm',         '8.1', 'x86_64', $deps, $template_php);
	$mod .= genModule('enterprise/8/debug-test82/x86_64',  $dest, '*.rpm',         '8.2', 'x86_64', $deps, $template_php);
	$mod .= genModule('enterprise/8/debug-test83/x86_64',  $dest, '*.rpm',         '8.3', 'x86_64', $deps, $template_php);
	createRepo($dest, $mod);
}
if (count($_SERVER['argv']) < 2 || in_array('el8', $_SERVER['argv']) || in_array('el8x', $_SERVER['argv'])
	|| in_array('noarch', $_SERVER['argv'])
	|| in_array('7.3', $_SERVER['argv']) || in_array('7.2', $_SERVER['argv'])) {
	$dest = 'enterprise/8/modular/x86_64';
	echo "Populate $dest\n";
	cleanup($dest);
	$mod  = '';

	$deps = ['platform' => 'el8'];
	$mod .= genModule('enterprise/8/php72/x86_64',  $dest, '*.rpm',         '7.2', 'x86_64', $deps, $template_php);
	$mod .= genModule('enterprise/8/php73/x86_64',  $dest, '*.rpm',         '7.3', 'x86_64', $deps, $template_php);
	$mod .= genModule('enterprise/8/php74/x86_64',  $dest, '*.rpm',         '7.4', 'x86_64', $deps, $template_php);
	$mod .= genModule('enterprise/8/php80/x86_64',  $dest, '*.rpm',         '8.0', 'x86_64', $deps, $template_php);
	$mod .= genModule('enterprise/8/php81/x86_64',  $dest, '*.rpm',         '8.1', 'x86_64', $deps, $template_php);
	$mod .= genModule('enterprise/8/php82/x86_64',  $dest, '*.rpm',         '8.2', 'x86_64', $deps, $template_php);
	$mod .= genModule('enterprise/8/php83/x86_64',  $dest, '*.rpm',         '8.3', 'x86_64', $deps, $template_php);
	$mod .= genDefaults('php', '7.2', ['remi-7.2', 'remi-7.3', 'remi-7.4', 'remi-8.0', 'remi-8.1', 'remi-8.2', 'remi-8.3']);

	$deps = ['platform' => 'el8'];
	$mod .= genModule('enterprise/8/redis50/x86_64', $dest, 'redis*.rpm', '5.0', 'x86_64', $deps, $template_redis);
	$mod .= genModule('enterprise/8/redis60/x86_64', $dest, 'redis*.rpm', '6.0', 'x86_64', $deps, $template_redis);
	$mod .= genModule('enterprise/8/redis62/x86_64', $dest, 'redis*.rpm', '6.2', 'x86_64', $deps, $template_redis);
	$mod .= genModule('enterprise/8/redis70/x86_64', $dest, 'redis*.rpm', '7.0', 'x86_64', $deps, $template_redis);
	$mod .= genModule('enterprise/8/redis72/x86_64', $dest, 'redis*.rpm', '7.2', 'x86_64', $deps, $template_redis);
	$mod .= genDefaults('redis', '5', ['remi-5.0', 'remi-6.0', 'remi-6.2', 'remi-7.0', 'remi-7.2']);

	$deps = ['platform' => 'el8', 'php' => ''];
	$mod .= genModule('enterprise/8/composer1/x86_64', $dest, '*.rpm',         '1', 'x86_64', $deps, $template_comp);
	$mod .= genModule('enterprise/8/composer2/x86_64', $dest, '*.rpm',         '2', 'x86_64', $deps, $template_comp);
	$mod .= genDefaults('composer', '2', ['1', '2']);
	createRepo($dest, $mod);
}
if (count($_SERVER['argv']) < 2 || in_array('el8', $_SERVER['argv']) || in_array('el8x', $_SERVER['argv'])
	|| in_array('7.3', $_SERVER['argv']) || in_array('7.2', $_SERVER['argv'])) {
	$dest = 'enterprise/8/debug-modular/x86_64';
	echo "Populate $dest\n";
	cleanup($dest);
	$mod  = '';

	$deps = ['platform' => 'el8'];
	$mod .= genModule('enterprise/8/debug-php72/x86_64',  $dest, '*.rpm',         '7.2', 'x86_64', $deps, $template_php);
	$mod .= genModule('enterprise/8/debug-php73/x86_64',  $dest, '*.rpm',         '7.3', 'x86_64', $deps, $template_php);
	$mod .= genModule('enterprise/8/debug-php74/x86_64',  $dest, '*.rpm',         '7.4', 'x86_64', $deps, $template_php);
	$mod .= genModule('enterprise/8/debug-php80/x86_64',  $dest, '*.rpm',         '8.0', 'x86_64', $deps, $template_php);
	$mod .= genModule('enterprise/8/debug-php81/x86_64',  $dest, '*.rpm',         '8.1', 'x86_64', $deps, $template_php);
	$mod .= genModule('enterprise/8/debug-php82/x86_64',  $dest, '*.rpm',         '8.2', 'x86_64', $deps, $template_php);
	$mod .= genModule('enterprise/8/debug-php83/x86_64',  $dest, '*.rpm',         '8.3', 'x86_64', $deps, $template_php);

	$deps = ['platform' => 'el8'];
	$mod .= genModule('enterprise/8/debug-redis50/x86_64', $dest, 'redis*.rpm', '5.0', 'x86_64', $deps, $template_redis);
	$mod .= genModule('enterprise/8/debug-redis60/x86_64', $dest, 'redis*.rpm', '6.0', 'x86_64', $deps, $template_redis);
	$mod .= genModule('enterprise/8/debug-redis62/x86_64', $dest, 'redis*.rpm', '6.2', 'x86_64', $deps, $template_redis);
	$mod .= genModule('enterprise/8/debug-redis70/x86_64', $dest, 'redis*.rpm', '7.0', 'x86_64', $deps, $template_redis);
	$mod .= genModule('enterprise/8/debug-redis72/x86_64', $dest, 'redis*.rpm', '7.2', 'x86_64', $deps, $template_redis);
	createRepo($dest, $mod);
}

if (in_array('el8', $_SERVER['argv']) || in_array('el8a', $_SERVER['argv']) || in_array('test', $_SERVER['argv'])) {
	$dest = 'enterprise/8/modular-test/aarch64';
	echo "Populate $dest\n";
	cleanup($dest);
	$mod  = '';

	$deps = ['platform' => 'el8'];
	$mod .= genModule('enterprise/8/test74/aarch64',  $dest, '*.rpm',         '7.4', 'aarch64', $deps, $template_php);
	$mod .= genModule('enterprise/8/test80/aarch64',  $dest, '*.rpm',         '8.0', 'aarch64', $deps, $template_php);
	$mod .= genModule('enterprise/8/test81/aarch64',  $dest, '*.rpm',         '8.1', 'aarch64', $deps, $template_php);
	$mod .= genModule('enterprise/8/test82/aarch64',  $dest, '*.rpm',         '8.2', 'aarch64', $deps, $template_php);
	$mod .= genModule('enterprise/8/test83/aarch64',  $dest, '*.rpm',         '8.3', 'aarch64', $deps, $template_php);

	$deps = ['platform' => 'el8', 'php' => ''];
	$mod .= genModule('enterprise/8/composer2-test/x86_64', $dest, '*.rpm',   '2', 'aarch64', $deps, $template_comp);
	createRepo($dest, $mod);

	$dest = 'enterprise/8/debug-modular-test/aarch64';
	echo "Populate $dest\n";
	cleanup($dest);
	$mod  = '';

	$deps = ['platform' => 'el8'];
	$mod .= genModule('enterprise/8/debug-test74/aarch64',  $dest, '*.rpm',         '7.4', 'aarch64', $deps, $template_php);
	$mod .= genModule('enterprise/8/debug-test80/aarch64',  $dest, '*.rpm',         '8.0', 'aarch64', $deps, $template_php);
	$mod .= genModule('enterprise/8/debug-test81/aarch64',  $dest, '*.rpm',         '8.1', 'aarch64', $deps, $template_php);
	$mod .= genModule('enterprise/8/debug-test82/aarch64',  $dest, '*.rpm',         '8.2', 'aarch64', $deps, $template_php);
	$mod .= genModule('enterprise/8/debug-test83/aarch64',  $dest, '*.rpm',         '8.3', 'aarch64', $deps, $template_php);
	createRepo($dest, $mod);
}
if (count($_SERVER['argv']) < 2 || in_array('el8', $_SERVER['argv']) || in_array('el8a', $_SERVER['argv'])
	|| in_array('noarch', $_SERVER['argv'])
	|| in_array('7.3', $_SERVER['argv']) || in_array('7.2', $_SERVER['argv'])) {
	$dest = 'enterprise/8/modular/aarch64';
	echo "Populate $dest\n";
	cleanup($dest);
	$mod  = '';

	$deps = ['platform' => 'el8'];
	$mod .= genModule('enterprise/8/php74/aarch64',  $dest, '*.rpm',         '7.4', 'aarch64', $deps, $template_php);
	$mod .= genModule('enterprise/8/php80/aarch64',  $dest, '*.rpm',         '8.0', 'aarch64', $deps, $template_php);
	$mod .= genModule('enterprise/8/php81/aarch64',  $dest, '*.rpm',         '8.1', 'aarch64', $deps, $template_php);
	$mod .= genModule('enterprise/8/php82/aarch64',  $dest, '*.rpm',         '8.2', 'aarch64', $deps, $template_php);
	$mod .= genModule('enterprise/8/php83/aarch64',  $dest, '*.rpm',         '8.3', 'aarch64', $deps, $template_php);
	$mod .= genDefaults('php', '7.2', ['remi-7.4', 'remi-8.0', 'remi-8.1', 'remi-8.2', 'remi-8.3']);

	$deps = ['platform' => 'el8'];
	$mod .= genModule('enterprise/8/redis60/aarch64', $dest, 'redis*.rpm', '6.0', 'aarch64', $deps, $template_redis);
	$mod .= genModule('enterprise/8/redis62/aarch64', $dest, 'redis*.rpm', '6.2', 'aarch64', $deps, $template_redis);
	$mod .= genModule('enterprise/8/redis70/aarch64', $dest, 'redis*.rpm', '7.0', 'aarch64', $deps, $template_redis);
	$mod .= genModule('enterprise/8/redis72/aarch64', $dest, 'redis*.rpm', '7.2', 'aarch64', $deps, $template_redis);
	$mod .= genDefaults('redis', '5', ['remi-6.0', 'remi-6.2', 'remi-7.0', 'remi-7.2']);

	$deps = ['platform' => 'el8', 'php' => ''];
	$mod .= genModule('enterprise/8/composer1/x86_64', $dest, '*.rpm',         '1', 'aarch64', $deps, $template_comp);
	$mod .= genModule('enterprise/8/composer2/x86_64', $dest, '*.rpm',         '2', 'aarch64', $deps, $template_comp);
	$mod .= genDefaults('composer', '2', ['1', '2']);
	createRepo($dest, $mod);
}
if (count($_SERVER['argv']) < 2 || in_array('el8', $_SERVER['argv']) || in_array('el8a', $_SERVER['argv'])
	|| in_array('7.3', $_SERVER['argv']) || in_array('7.2', $_SERVER['argv'])) {
	$dest = 'enterprise/8/debug-modular/aarch64';
	echo "Populate $dest\n";
	cleanup($dest);
	$mod  = '';

	$deps = ['platform' => 'el8'];
	$mod .= genModule('enterprise/8/debug-php74/aarch64',  $dest, '*.rpm',         '7.4', 'aarch64', $deps, $template_php);
	$mod .= genModule('enterprise/8/debug-php80/aarch64',  $dest, '*.rpm',         '8.0', 'aarch64', $deps, $template_php);
	$mod .= genModule('enterprise/8/debug-php81/aarch64',  $dest, '*.rpm',         '8.1', 'aarch64', $deps, $template_php);
	$mod .= genModule('enterprise/8/debug-php82/aarch64',  $dest, '*.rpm',         '8.2', 'aarch64', $deps, $template_php);
	$mod .= genModule('enterprise/8/debug-php83/aarch64',  $dest, '*.rpm',         '8.3', 'aarch64', $deps, $template_php);

	$deps = ['platform' => 'el8'];
	$mod .= genModule('enterprise/8/debug-redis60/aarch64', $dest, 'redis*.rpm', '6.0', 'aarch64', $deps, $template_redis);
	$mod .= genModule('enterprise/8/debug-redis62/aarch64', $dest, 'redis*.rpm', '6.2', 'aarch64', $deps, $template_redis);
	$mod .= genModule('enterprise/8/debug-redis70/aarch64', $dest, 'redis*.rpm', '7.0', 'aarch64', $deps, $template_redis);
	$mod .= genModule('enterprise/8/debug-redis72/aarch64', $dest, 'redis*.rpm', '7.2', 'aarch64', $deps, $template_redis);
	createRepo($dest, $mod);
}

if (in_array('el9', $_SERVER['argv']) || in_array('test', $_SERVER['argv'])) {
	$dest = 'enterprise/9/modular-test/x86_64';
	echo "Populate $dest\n";
	cleanup($dest);
	$mod  = '';

	$deps = ['platform' => 'el9'];
	$mod .= genModule('enterprise/9/test74/x86_64',  $dest, '*.rpm',         '7.4', 'x86_64', $deps, $template_php);
	$mod .= genModule('enterprise/9/test80/x86_64',  $dest, '*.rpm',         '8.0', 'x86_64', $deps, $template_php);
	$mod .= genModule('enterprise/9/test81/x86_64',  $dest, '*.rpm',         '8.1', 'x86_64', $deps, $template_php);
	$mod .= genModule('enterprise/9/test82/x86_64',  $dest, '*.rpm',         '8.2', 'x86_64', $deps, $template_php);
	$mod .= genModule('enterprise/9/test83/x86_64',  $dest, '*.rpm',         '8.3', 'x86_64', $deps, $template_php);

	$deps = ['platform' => 'el9', 'php' => ''];
	$mod .= genModule('enterprise/9/composer2-test/x86_64', $dest, '*.rpm',   '2', 'x86_64', $deps, $template_comp);
	createRepo($dest, $mod);

	$dest = 'enterprise/9/debug-modular-test/x86_64';
	echo "Populate $dest\n";
	cleanup($dest);
	$mod  = '';

	$deps = ['platform' => 'el9'];
	$mod .= genModule('enterprise/9/debug-test74/x86_64',  $dest, '*.rpm',         '7.4', 'x86_64', $deps, $template_php);
	$mod .= genModule('enterprise/9/debug-test80/x86_64',  $dest, '*.rpm',         '8.0', 'x86_64', $deps, $template_php);
	$mod .= genModule('enterprise/9/debug-test81/x86_64',  $dest, '*.rpm',         '8.1', 'x86_64', $deps, $template_php);
	$mod .= genModule('enterprise/9/debug-test82/x86_64',  $dest, '*.rpm',         '8.2', 'x86_64', $deps, $template_php);
	$mod .= genModule('enterprise/9/debug-test83/x86_64',  $dest, '*.rpm',         '8.3', 'x86_64', $deps, $template_php);
	createRepo($dest, $mod);
}

if (count($_SERVER['argv']) < 2 || in_array('el9', $_SERVER['argv'])
	|| in_array('noarch', $_SERVER['argv'])) {
	$dest = 'enterprise/9/modular/x86_64';
	echo "Populate $dest\n";
	cleanup($dest);
	$mod  = '';

	$deps = ['platform' => 'el9'];
	$mod .= genModule('enterprise/9/php74/x86_64',  $dest, '*.rpm',         '7.4', 'x86_64', $deps, $template_php);
	$mod .= genModule('enterprise/9/php80/x86_64',  $dest, '*.rpm',         '8.0', 'x86_64', $deps, $template_php);
	$mod .= genModule('enterprise/9/php81/x86_64',  $dest, '*.rpm',         '8.1', 'x86_64', $deps, $template_php);
	$mod .= genModule('enterprise/9/php82/x86_64',  $dest, '*.rpm',         '8.2', 'x86_64', $deps, $template_php);
	$mod .= genModule('enterprise/9/php83/x86_64',  $dest, '*.rpm',         '8.3', 'x86_64', $deps, $template_php);
	$mod .= genDefaults('php', false, ['remi-7.4', 'remi-8.0', 'remi-8.1', 'remi-8.2', 'remi-8.3']);

	$mod .= genModule('enterprise/9/redis50/x86_64', $dest, 'redis*.rpm', '5.0', 'x86_64', $deps, $template_redis);
	$mod .= genModule('enterprise/9/redis60/x86_64', $dest, 'redis*.rpm', '6.0', 'x86_64', $deps, $template_redis);
	$mod .= genModule('enterprise/9/redis62/x86_64', $dest, 'redis*.rpm', '6.2', 'x86_64', $deps, $template_redis);
	$mod .= genModule('enterprise/9/redis70/x86_64', $dest, 'redis*.rpm', '7.0', 'x86_64', $deps, $template_redis);
	$mod .= genModule('enterprise/9/redis72/x86_64', $dest, 'redis*.rpm', '7.2', 'x86_64', $deps, $template_redis);
	$mod .= genDefaults('redis', false, ['remi-5.0', 'remi-6.0', 'remi-6.2', 'remi-7.0', 'remi-7.2']);

	$mod .= genModule('enterprise/9/memcached/x86_64', $dest, 'mem*.rpm', false, 'x86_64', $deps, $template_memcached);
	$mod .= genDefaults('memcached', false, ['remi']);

	$mod .= genModule('enterprise/9/composer2/x86_64', $dest, '*.rpm',         '2', 'x86_64', $deps, $template_comp);
	$mod .= genDefaults('composer', false, ['2']);
	createRepo($dest, $mod);
}
if (count($_SERVER['argv']) < 2 || in_array('el9', $_SERVER['argv'])) {
	$dest = 'enterprise/9/debug-modular/x86_64';
	echo "Populate $dest\n";
	cleanup($dest);
	$mod  = '';

	$deps = ['platform' => 'el9'];
	$mod .= genModule('enterprise/9/debug-php74/x86_64',  $dest, '*.rpm',         '7.4', 'x86_64', $deps, $template_php);
	$mod .= genModule('enterprise/9/debug-php80/x86_64',  $dest, '*.rpm',         '8.0', 'x86_64', $deps, $template_php);
	$mod .= genModule('enterprise/9/debug-php81/x86_64',  $dest, '*.rpm',         '8.1', 'x86_64', $deps, $template_php);
	$mod .= genModule('enterprise/9/debug-php82/x86_64',  $dest, '*.rpm',         '8.2', 'x86_64', $deps, $template_php);
	$mod .= genModule('enterprise/9/debug-php83/x86_64',  $dest, '*.rpm',         '8.3', 'x86_64', $deps, $template_php);

	$mod .= genModule('enterprise/9/debug-redis50/x86_64', $dest, 'redis*.rpm', '5.0', 'x86_64', $deps, $template_redis);
	$mod .= genModule('enterprise/9/debug-redis60/x86_64', $dest, 'redis*.rpm', '6.0', 'x86_64', $deps, $template_redis);
	$mod .= genModule('enterprise/9/debug-redis62/x86_64', $dest, 'redis*.rpm', '6.2', 'x86_64', $deps, $template_redis);
	$mod .= genModule('enterprise/9/debug-redis70/x86_64', $dest, 'redis*.rpm', '7.0', 'x86_64', $deps, $template_redis);
	$mod .= genModule('enterprise/9/debug-redis72/x86_64', $dest, 'redis*.rpm', '7.2', 'x86_64', $deps, $template_redis);

	$mod .= genModule('enterprise/9/debug-memcached/x86_64', $dest, 'mem*.rpm', false, 'x86_64', $deps, $template_memcached);
	createRepo($dest, $mod);
}

if (count($_SERVER['argv']) < 2 || in_array('el9', $_SERVER['argv'])
	|| in_array('noarch', $_SERVER['argv'])) {
	$dest = 'enterprise/9/modular/aarch64';
	echo "Populate $dest\n";
	cleanup($dest);
	$mod  = '';

	$deps = ['platform' => 'el9'];
	$mod .= genModule('enterprise/9/php74/aarch64',  $dest, '*.rpm',         '7.4', 'aarch64', $deps, $template_php);
	$mod .= genModule('enterprise/9/php80/aarch64',  $dest, '*.rpm',         '8.0', 'aarch64', $deps, $template_php);
	$mod .= genModule('enterprise/9/php81/aarch64',  $dest, '*.rpm',         '8.1', 'aarch64', $deps, $template_php);
	$mod .= genModule('enterprise/9/php82/aarch64',  $dest, '*.rpm',         '8.2', 'aarch64', $deps, $template_php);
	$mod .= genModule('enterprise/9/php83/aarch64',  $dest, '*.rpm',         '8.3', 'aarch64', $deps, $template_php);
	$mod .= genDefaults('php', false, ['remi-7.4', 'remi-8.0', 'remi-8.1', 'remi-8.2', 'remi-8.3']);

//	$mod .= genModule('enterprise/9/redis50/aarch64', $dest, 'redis*.rpm', '5.0', 'aarch64', $deps, $template_redis);
	$mod .= genModule('enterprise/9/redis60/aarch64', $dest, 'redis*.rpm', '6.0', 'aarch64', $deps, $template_redis);
	$mod .= genModule('enterprise/9/redis62/aarch64', $dest, 'redis*.rpm', '6.2', 'aarch64', $deps, $template_redis);
	$mod .= genModule('enterprise/9/redis70/aarch64', $dest, 'redis*.rpm', '7.0', 'aarch64', $deps, $template_redis);
	$mod .= genModule('enterprise/9/redis72/aarch64', $dest, 'redis*.rpm', '7.2', 'aarch64', $deps, $template_redis);
	$mod .= genDefaults('redis', false, ['remi-6.2', 'remi-7.0', 'remi-7.2']);

	$mod .= genModule('enterprise/9/memcached/aarch64', $dest, 'mem*.rpm', false, 'aarch64', $deps, $template_memcached);
	$mod .= genDefaults('memcached', false, ['remi']);

	$mod .= genModule('enterprise/9/composer2/x86_64', $dest, '*noarch.rpm', '2', 'aarch64', $deps, $template_comp);
	$mod .= genDefaults('composer', false, ['2']);
	createRepo($dest, $mod);
}
if (count($_SERVER['argv']) < 2 || in_array('el9', $_SERVER['argv'])) {
	$dest = 'enterprise/9/debug-modular/aarch64';
	echo "Populate $dest\n";
	cleanup($dest);
	$mod  = '';

	$deps = ['platform' => 'el9'];
	$mod .= genModule('enterprise/9/debug-php74/aarch64',  $dest, '*.rpm',         '7.4', 'aarch64', $deps, $template_php);
	$mod .= genModule('enterprise/9/debug-php80/aarch64',  $dest, '*.rpm',         '8.0', 'aarch64', $deps, $template_php);
	$mod .= genModule('enterprise/9/debug-php81/aarch64',  $dest, '*.rpm',         '8.1', 'aarch64', $deps, $template_php);
	$mod .= genModule('enterprise/9/debug-php82/aarch64',  $dest, '*.rpm',         '8.2', 'aarch64', $deps, $template_php);
	$mod .= genModule('enterprise/9/debug-php83/aarch64',  $dest, '*.rpm',         '8.3', 'aarch64', $deps, $template_php);

//	$mod .= genModule('enterprise/9/debug-redis50/aarch64', $dest, 'redis*.rpm', '5.0', 'aarch64', $deps, $template_redis);
	$mod .= genModule('enterprise/9/debug-redis60/aarch64', $dest, 'redis*.rpm', '6.0', 'aarch64', $deps, $template_redis);
	$mod .= genModule('enterprise/9/debug-redis62/aarch64', $dest, 'redis*.rpm', '6.2', 'aarch64', $deps, $template_redis);
	$mod .= genModule('enterprise/9/debug-redis70/aarch64', $dest, 'redis*.rpm', '7.0', 'aarch64', $deps, $template_redis);
	$mod .= genModule('enterprise/9/debug-redis72/aarch64', $dest, 'redis*.rpm', '7.2', 'aarch64', $deps, $template_redis);

	$mod .= genModule('enterprise/9/debug-memcached/aarch64', $dest, 'mem*.rpm', false, 'aarch64', $deps, $template_memcached);
	createRepo($dest, $mod);
}

if (in_array('el9', $_SERVER['argv']) || in_array('test', $_SERVER['argv'])) {
	$dest = 'enterprise/9/modular-test/aarch64';
	echo "Populate $dest\n";
	cleanup($dest);
	$mod  = '';

	$deps = ['platform' => 'el9'];
	$mod .= genModule('enterprise/9/test74/aarch64',  $dest, '*.rpm',         '7.4', 'aarch64', $deps, $template_php);
	$mod .= genModule('enterprise/9/test80/aarch64',  $dest, '*.rpm',         '8.0', 'aarch64', $deps, $template_php);
	$mod .= genModule('enterprise/9/test81/aarch64',  $dest, '*.rpm',         '8.1', 'aarch64', $deps, $template_php);
	$mod .= genModule('enterprise/9/test82/aarch64',  $dest, '*.rpm',         '8.2', 'aarch64', $deps, $template_php);
	$mod .= genModule('enterprise/9/test83/aarch64',  $dest, '*.rpm',         '8.3', 'aarch64', $deps, $template_php);

	$deps = ['platform' => 'el9', 'php' => ''];
	$mod .= genModule('enterprise/9/composer2-test/x86_64', $dest, '*.rpm',   '2', 'x86_64', $deps, $template_comp);
	createRepo($dest, $mod);

	$dest = 'enterprise/9/debug-modular-test/x86_64';
	echo "Populate $dest\n";
	cleanup($dest);
	$mod  = '';

	$deps = ['platform' => 'el9'];
	$mod .= genModule('enterprise/9/debug-test74/aarch64',  $dest, '*.rpm',         '7.4', 'aarch64', $deps, $template_php);
	$mod .= genModule('enterprise/9/debug-test80/aarch64',  $dest, '*.rpm',         '8.0', 'aarch64', $deps, $template_php);
	$mod .= genModule('enterprise/9/debug-test81/aarch64',  $dest, '*.rpm',         '8.1', 'aarch64', $deps, $template_php);
	$mod .= genModule('enterprise/9/debug-test82/aarch64',  $dest, '*.rpm',         '8.2', 'aarch64', $deps, $template_php);
	$mod .= genModule('enterprise/9/debug-test83/aarch64',  $dest, '*.rpm',         '8.3', 'aarch64', $deps, $template_php);
	createRepo($dest, $mod);
}

if (count($_SERVER['argv']) > 1 && in_array('epel', $_SERVER['argv'])) {
	$dest = 'temp/epel-8-modular';
	echo "Populate $dest\n";
	cleanup($dest);
	$mod  = '';

	$deps = ['platform' => 'el8', 'php' => '7.2'];
	$mod .= genModule('temp/epel-8-php-7.2',  $dest, '*.rpm',         '7.2', 'x86_64', $deps, $template_phpextras);
	$deps = ['platform' => 'el8', 'php' => '7.3'];
	$mod .= genModule('temp/epel-8-php-7.3',  $dest, '*.rpm',         '7.3', 'x86_64', $deps, $template_phpextras);
	$deps = ['platform' => 'el8', 'php' => '7.4'];
	$mod .= genModule('temp/epel-8-php-7.4',  $dest, '*.rpm',         '7.4', 'x86_64', $deps, $template_phpextras);
	$mod .= genDefaults('php-extras', '7.2', ['7.2', '7.3', '7.4']);
	createRepo($dest, $mod);
}

if (in_array('el7', $_SERVER['argv']) || in_array('test', $_SERVER['argv'])) {
	$dest = 'enterprise/7/modular-test/x86_64';
	echo "Populate $dest\n";
	cleanup($dest);
	$mod  = '';

	$deps = ['platform' => 'el7'];
	$mod .= genModule('enterprise/7/test71/x86_64',  $dest, '*.rpm',         '7.1', 'x86_64', $deps, $template_php);
	$mod .= genModule('enterprise/7/test72/x86_64',  $dest, '*.rpm',         '7.2', 'x86_64', $deps, $template_php);
	$mod .= genModule('enterprise/7/test73/x86_64',  $dest, '*.rpm',         '7.3', 'x86_64', $deps, $template_php);
	$mod .= genModule('enterprise/7/test74/x86_64',  $dest, '*.rpm',         '7.4', 'x86_64', $deps, $template_php);
	$mod .= genModule('enterprise/7/test80/x86_64',  $dest, '*.rpm',         '8.0', 'x86_64', $deps, $template_php);
	$mod .= genModule('enterprise/7/test81/x86_64',  $dest, '*.rpm',         '8.1', 'x86_64', $deps, $template_php);
	$mod .= genModule('enterprise/7/test82/x86_64',  $dest, '*.rpm',         '8.2', 'x86_64', $deps, $template_php);
	$mod .= genModule('enterprise/7/test83/x86_64',  $dest, '*.rpm',         '8.3', 'x86_64', $deps, $template_php);
	createRepo($dest, $mod);
}
if (count($_SERVER['argv']) < 2 || in_array('el7', $_SERVER['argv'])
	|| in_array('7.3', $_SERVER['argv']) || in_array('7.2', $_SERVER['argv']) || in_array('7.1', $_SERVER['argv'])) {
	$dest = 'enterprise/7/modular/x86_64';
	echo "Populate $dest\n";
	cleanup($dest);
	$mod  = '';

	$deps = ['platform' => 'el7'];
	$mod .= genModule('enterprise/7/php71/x86_64',  $dest, '*.rpm',         '7.1', 'x86_64', $deps, $template_php);
	$mod .= genModule('enterprise/7/php72/x86_64',  $dest, '*.rpm',         '7.2', 'x86_64', $deps, $template_php);
	$mod .= genModule('enterprise/7/php73/x86_64',  $dest, '*.rpm',         '7.3', 'x86_64', $deps, $template_php);
	$mod .= genModule('enterprise/7/php74/x86_64',  $dest, '*.rpm',         '7.4', 'x86_64', $deps, $template_php);
	$mod .= genModule('enterprise/7/php80/x86_64',  $dest, '*.rpm',         '8.0', 'x86_64', $deps, $template_php);
	$mod .= genModule('enterprise/7/php81/x86_64',  $dest, '*.rpm',         '8.1', 'x86_64', $deps, $template_php);
	$mod .= genModule('enterprise/7/php82/x86_64',  $dest, '*.rpm',         '8.2', 'x86_64', $deps, $template_php);
	$mod .= genModule('enterprise/7/php83/x86_64',  $dest, '*.rpm',         '8.3', 'x86_64', $deps, $template_php);
	$mod .= genDefaults('php', '7.2', ['remi-7.1', 'remi-7.2', 'remi-7.3', 'remi-7.4', 'remi-8.0', 'remi-8.1', 'remi-8.2', 'remi-8.3']);

	$mod .= genModule('enterprise/7/remi/x86_64',  $dest, 'redis*5.0*.rpm', '5.0', 'x86_64', $deps, $template_redis);
	$mod .= genModule('enterprise/7/remi/x86_64',  $dest, 'redis*6.0*.rpm', '6.0', 'x86_64', $deps, $template_redis);
	$mod .= genModule('enterprise/7/remi/x86_64',  $dest, 'redis*6.2*.rpm', '6.2', 'x86_64', $deps, $template_redis);
	$mod .= genModule('enterprise/7/remi/x86_64',  $dest, 'redis*7.0*.rpm', '7.0', 'x86_64', $deps, $template_redis);
	$mod .= genDefaults('redis', '5', ['remi-5.0', 'remi-6.0', 'remi-6.2', 'remi-7.0', 'remi-7.2']);
	createRepo($dest, $mod);
}
echo "Done\n";