From b1fdcf9631be7e4577bc8fd61eec8e51d2025ef2 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Tue, 27 Sep 2016 21:33:33 -0400 Subject: [PATCH] CRM-19417 - distmaker - Change report to key-value format. Add version. --- distmaker/dists/common.sh | 9 ++++++++- distmaker/dists/repo-report.sh | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/distmaker/dists/common.sh b/distmaker/dists/common.sh index bf8d35f8ee..9f2047ffb8 100644 --- a/distmaker/dists/common.sh +++ b/distmaker/dists/common.sh @@ -240,6 +240,10 @@ function dm_git_checkout() { popd } +function dm_key_value() { + echo -e "$1\n$2" | php -r '$lines = explode("\n", rtrim(file_get_contents("php://stdin"), "\r\n"), 2); fputcsv(STDOUT, $lines);' +} + ## usage: dm_repo_report function dm_repo_report() { local COMMIT @@ -249,5 +253,8 @@ function dm_repo_report() { popd >> /dev/null fi [ -z "$COMMIT" ] && COMMIT=NONE - echo "$1 $3 $COMMIT" + + #echo -e "$1\n$3\n$COMMIT" | php -r '$lines = explode("\n", rtrim(file_get_contents("php://stdin"), "\r\n")); fputcsv(STDOUT, $lines);' + dm_key_value "${1}.branch" $3 + dm_key_value "${1}.commit" $COMMIT } diff --git a/distmaker/dists/repo-report.sh b/distmaker/dists/repo-report.sh index e8ee307979..2bbb705f5d 100755 --- a/distmaker/dists/repo-report.sh +++ b/distmaker/dists/repo-report.sh @@ -14,7 +14,7 @@ fi SRC=$DM_SOURCEDIR REPORT="$DM_TARGETDIR/civicrm-$DM_VERSION-repos.txt" -echo '# ' > "$REPORT" +dm_key_value version "$DM_VERSION" > $REPORT dm_repo_report "civicrm-core" "$DM_SOURCEDIR" "$DM_REF_CORE" >> $REPORT dm_repo_report "civicrm-backdrop@1.x" "$DM_SOURCEDIR/backdrop" "$DM_REF_BACKDROP" >> $REPORT dm_repo_report "civicrm-drupal@6.x" "$DM_SOURCEDIR/drupal" "$DM_REF_DRUPAL6" >> $REPORT -- 2.25.1