Dedupe permissions - allow safe mode merging based on 'merge duplicate contacts'
[civicrm-core.git] / distmaker / utils / repo-report.php
CommitLineData
a714ed5f
TO
1<?php
2
89d193fd
TO
3/**
4 * Make a small report about the git content in a given folder+branch.
5 * @param string $path
6 * @param string $branch
7 * @return array
8 * - branch: string
9 * - commit: string
10 */
a714ed5f
TO
11function repo($path, $branch) {
12 $escPath = escapeshellarg($path);
13 $escBranch = escapeshellarg($branch);
89d193fd
TO
14 $commit = file_exists($path) ? trim(`cd $escPath ; git show $escBranch | head -n1 | cut -f2 -d\ `) : NULL;
15 if (!empty($commit)) {
16 return array(
17 'branch' => $branch,
18 'commit' => $commit,
19 );
d147a9c9
TO
20 }
21 else {
89d193fd
TO
22 return array();
23 }
a714ed5f
TO
24}
25
26$DM_SOURCEDIR = getenv('DM_SOURCEDIR');
f9702176 27$DM_VERSION = getenv('DM_VERSION');
a714ed5f 28$data = array(
f9702176 29 'version' => $DM_VERSION,
a714ed5f
TO
30 'timestamp' => array(
31 'pretty' => date('r'),
32 'epoch' => time(),
33 ),
f9702176
TO
34 'tar' => array(),
35 'git' => array(
36 'civicrm-backdrop@1.x' => repo("$DM_SOURCEDIR/backdrop", getenv('DM_REF_BACKDROP')),
37 'civicrm-core' => repo("$DM_SOURCEDIR", getenv('DM_REF_CORE')),
38 'civicrm-drupal@6.x' => repo("$DM_SOURCEDIR/drupal", getenv('DM_REF_DRUPAL6')),
39 'civicrm-drupal@7.x' => repo("$DM_SOURCEDIR/drupal", getenv('DM_REF_DRUPAL')),
3476a08c 40 'civicrm-drupal-8' => repo("$DM_SOURCEDIR/drupal-8", getenv('DM_REF_DRUPAL8')),
d147a9c9 41 'civicrm-joomla' => repo("$DM_SOURCEDIR/joomla", getenv('DM_REF_JOOMLA')),
f9702176
TO
42 'civicrm-packages' => repo("$DM_SOURCEDIR/packages", getenv('DM_REF_PACKAGES')),
43 'civicrm-wordpress' => repo("$DM_SOURCEDIR/WordPress", getenv('DM_REF_WORDPRESS')),
44 ),
a714ed5f 45);
f9702176
TO
46
47if (getenv('BPACK')) {
48 $data['tar']['Backdrop'] = "civicrm-$DM_VERSION-backdrop-unstable.tar.gz";
49}
50if (getenv('J5PACK')) {
51 $data['tar']['Joomla'] = "civicrm-$DM_VERSION-joomla.zip";
52}
53if (getenv('D56PACK')) {
54 $data['tar']['Drupal6'] = "civicrm-$DM_VERSION-drupal6.tar.gz";
55}
56if (getenv('D5PACK')) {
57 $data['tar']['Drupal'] = "civicrm-$DM_VERSION-drupal.tar.gz";
58}
59if (getenv('WPPACK')) {
56d20023 60 $data['tar']['WordPress'] = "civicrm-$DM_VERSION-wordpress.zip";
f9702176
TO
61}
62if (getenv('L10NPACK')) {
63 $data['tar']['L10n'] = "civicrm-$DM_VERSION-l10n.tar.gz";
64}
65
a714ed5f 66ksort($data);
56d20023
TO
67ksort($data['tar']);
68ksort($data['git']);
89d193fd 69$data['rev'] = $DM_VERSION . '-' . md5(json_encode($data));
a714ed5f 70echo json_encode($data);