aboutsummaryrefslogtreecommitdiff
path: root/files
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2018-02-07 17:06:52 -0200
committerSilvio Rhatto <rhatto@riseup.net>2018-02-07 17:06:52 -0200
commit4eb96f1bca96a58c7d07a38cfde3614441963401 (patch)
treef1357c199774184e740b11c90a39857b9160ad16 /files
parent8a4060bccd7e103618f6d724bf327f6fc2ab630d (diff)
downloadpuppet-drupal-4eb96f1bca96a58c7d07a38cfde3614441963401.tar.gz
puppet-drupal-4eb96f1bca96a58c7d07a38cfde3614441963401.tar.bz2
Latest: operate only on stable releases, filtering out dev, alpha, beta and rc releases
Diffstat (limited to 'files')
-rwxr-xr-xfiles/drupal3
1 files changed, 2 insertions, 1 deletions
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 "(?<=<download_link>)[^<]+" | head -1`"
+ latest="`wget -O- -q https://updates.drupal.org/release-history/drupal/${series}.x | grep -oPm1 "(?<=<download_link>)[^<]+" | 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$//'