From 1f444343b463cf0b6e1e4fc06f7351e5cc11bcf5 Mon Sep 17 00:00:00 2001 From: Tim Bishop Date: Wed, 27 Apr 2016 16:26:25 +0100 Subject: [PATCH] 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. --- manifests/ppa.pp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) 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 {