From: Silvio Rhatto Date: Wed, 7 Feb 2018 19:06:52 +0000 (-0200) Subject: Latest: operate only on stable releases, filtering out dev, alpha, beta and rc releases X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=4eb96f1bca96a58c7d07a38cfde3614441963401;p=puppet-drupal.git Latest: operate only on stable releases, filtering out dev, alpha, beta and rc releases --- diff --git a/files/drupal b/files/drupal index 94cffe9..50b0fcc 100755 --- a/files/drupal +++ b/files/drupal @@ -163,6 +163,7 @@ function drupal_current { } # Get the latest version of a given series +# Operate only on stable releases, filtering out dev, alpha, beta and rc releases # https://drupal.stackexchange.com/questions/23700/how-to-find-download-latest-drupal-version-via-bash#23704 function drupal_latest { local series="$1" @@ -171,7 +172,7 @@ function drupal_latest { series="8" fi - latest="`wget -O- -q https://updates.drupal.org/release-history/drupal/${series}.x | grep -oPm1 "(?<=)[^<]+" | head -1`" + latest="`wget -O- -q https://updates.drupal.org/release-history/drupal/${series}.x | grep -oPm1 "(?<=)[^<]+" | grep -v -- '-dev' | grep -v -- '-alpha' | grep -v -- '-beta' | grep -v -- '-rc' | head -1`" latest="`basename $latest`" echo $latest | sed -e 's/^drupal-//' -e 's/.tar.gz$//'