]> review.fuel-infra Code Review - puppet-modules/puppetlabs-apt.git/commitdiff
Fix version check on 16.04.
authorTim Bishop <tim@bishnet.net>
Wed, 27 Apr 2016 15:26:25 +0000 (16:26 +0100)
committerTim Bishop <tim@bishnet.net>
Wed, 27 Apr 2016 15:26:25 +0000 (16:26 +0100)
The old test obviously broke on 16.04. Switch to using versioncmp
since it does the right thing for us.

manifests/ppa.pp

index 7069e2ed09949dde0666a746a30d758e8f5bbb68..dfa3d08dd6235e55c12d10b83e465399980b152c 100644 (file)
@@ -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 {