From: Tim Bishop Date: Wed, 27 Apr 2016 15:26:25 +0000 (+0100) Subject: Fix version check on 16.04. X-Git-Tag: 2.3.0~17^2 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=1f444343b463cf0b6e1e4fc06f7351e5cc11bcf5;p=puppet-modules%2Fpuppetlabs-apt.git Fix version check on 16.04. The old test obviously broke on 16.04. Switch to using versioncmp since it does the right thing for us. --- diff --git a/manifests/ppa.pp b/manifests/ppa.pp index 7069e2e..dfa3d08 100644 --- a/manifests/ppa.pp +++ b/manifests/ppa.pp @@ -14,10 +14,7 @@ define apt::ppa( fail('apt::ppa is not currently supported on Debian.') } - $ubuntu_release_year = regsubst($::apt::xfacts['lsbdistrelease'], '\.\d+$', '', 'G') + 0 - $ubuntu_release_month = regsubst($::apt::xfacts['lsbdistrelease'], '^\d+\.', '', 'G') + 0 - - if $ubuntu_release_year >= 15 and $ubuntu_release_month >= 10 { + if versioncmp($::apt::xfacts['lsbdistrelease'], '15.10') >= 0 { $distid = downcase($::apt::xfacts['lsbdistid']) $filename = regsubst($name, '^ppa:([^/]+)/(.+)$', "\\1-${distid}-\\2-${release}") } else {