From: Tim Otten Date: Wed, 28 Sep 2016 00:42:59 +0000 (-0400) Subject: CRM-19417 - distmaker - Generate report about git revisions X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=f9128cb9bde5e401af3b5abcce04d6d255c8a9a5;p=civicrm-core.git CRM-19417 - distmaker - Generate report about git revisions --- diff --git a/distmaker/distmaker.sh b/distmaker/distmaker.sh index 7347213bb0..fca550e812 100755 --- a/distmaker/distmaker.sh +++ b/distmaker/distmaker.sh @@ -43,6 +43,7 @@ J5PACK=0 WP5PACK=0 SK5PACK=0 L10NPACK=0 +REPOREPORT=0 # Display usage display_usage() @@ -192,6 +193,12 @@ case $1 in WP5PACK=1 ;; + # REPO REPORT PHP5 + report) + echo; echo "Generating repo report module"; echo; + REPOREPORT=1 + ;; + # ALL all) echo; echo "Generating all the tarballs we've got (not the directories). "; echo; @@ -202,6 +209,7 @@ case $1 in WP5PACK=1 SKPACK=1 L10NPACK=1 + REPOREPORT=1 ;; # USAGE @@ -289,5 +297,10 @@ if [ "$WP5PACK" = 1 ]; then bash $P/dists/wordpress_php5.sh fi +if [ "$REPOREPORT" = 1 ]; then + echo; echo "Preparing repository report"; echo; + bash $P/dists/repo-report.sh +fi + unset DM_SOURCEDIR DM_GENFILESDIR DM_TARGETDIR DM_TMPDIR DM_PHP DM_RSYNC DM_VERSION DM_ZIP echo;echo "DISTMAKER Done.";echo; diff --git a/distmaker/dists/common.sh b/distmaker/dists/common.sh index b3096060ce..2a81e49317 100644 --- a/distmaker/dists/common.sh +++ b/distmaker/dists/common.sh @@ -239,3 +239,15 @@ function dm_git_checkout() { git checkout "$2" popd } + +## usage: dm_repo_report +function dm_repo_report() { + local COMMIT + if [ -d "$2" ]; then + pushd "$2" >> /dev/null + COMMIT=$(git show "$3" | head -n1 | cut -f2 -d\ ) + popd >> /dev/null + fi + [ -z "$COMMIT" ] && COMMIT=NONE + echo "$1 $3 $COMMIT" +} diff --git a/distmaker/dists/repo-report.sh b/distmaker/dists/repo-report.sh new file mode 100755 index 0000000000..e8ee307979 --- /dev/null +++ b/distmaker/dists/repo-report.sh @@ -0,0 +1,25 @@ +#!/bin/bash +set -ex + +P=`dirname $0` +CFFILE=$P/../distmaker.conf +if [ ! -f $CFFILE ] ; then + echo "NO DISTMAKER.CONF FILE!" + exit 1 +else + . $CFFILE +fi +. "$P/common.sh" + +SRC=$DM_SOURCEDIR +REPORT="$DM_TARGETDIR/civicrm-$DM_VERSION-repos.txt" + +echo '# ' > "$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 +dm_repo_report "civicrm-drupal@7.x" "$DM_SOURCEDIR/drupal" "$DM_REF_DRUPAL" >> $REPORT +#dm_repo_report "civicrm-drupal@8.x" "$DM_SOURCEDIR/drupal" "$DM_REF_DRUPAL8" >> $REPORT +dm_repo_report "civicrm-joomla" "$DM_SOURCEDIR/joomla" "$DM_REF_JOOMLA" >> $REPORT +dm_repo_report "civicrm-wordpress" "$DM_SOURCEDIR/WordPress" "$DM_REF_WORDPRESS" >> $REPORT +dm_repo_report "civicrm-packages" "$DM_SOURCEDIR/packages" "$DM_REF_PACKAGES" >> $REPORT