Jira (PUP-10299) Add SemVerRange support to zypper package provider

21 views
Skip to first unread message

Gabriel Nagy (JIRA)

unread,
Feb 18, 2020, 7:30:04 AM2/18/20
to puppe...@googlegroups.com
Gabriel Nagy created an issue
 
Puppet / New Feature PUP-10299
Add SemVerRange support to zypper package provider
Issue Type: New Feature New Feature
Assignee: Unassigned
Created: 2020/02/18 4:29 AM
Priority: Normal Normal
Reporter: Gabriel Nagy

Implement SemVerRange type support for the zypper provider.

Sample manifest with a range passed for a package:

package { 'puppet-agent':
  # this will be parsed as: >= 6.0.0 < 6.1.0
  ensure => SemVerRange('~> 6.0')
}
 
package { 'puppet-agent':
  ensure => SemVerRange('>= 6.5')
}
 
package { 'puppet-agent':
  ensure => SemVerRange('< 6.4')
}
 
package { 'puppet-agent':
  # this is a valid range which we can support
  ensure => SemVerRange('~> 6.0 || ~> 6.11')
}

The zypper provider does not support a version range passed in the install command, so we have to:

  • find out the available versions for a specific package (usually with zypper search -s)
  • install the most recent package which respects the range.

We should also make sure we don't take additional actions if the range is already satisfied (i.e. puppet apply with a SemVerRange should be idempotent)

Sample code on how the ensure property can be treated inside the provider:

if @resource.should(:ensure).is_a?(SemanticPuppet::VersionRange)
  # these should be sorted in descending order
  _, *versions = `zypper -q se -s #{@resource.name} | awk '{print $6}'`.split
  range = @resource.should(:ensure)
 
  available.versions.any? { |version| range.include?(version.to_stable) }
end

Example zypper install with a specific version:

zypper install puppet-agent=6.0.10-1.sles15

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)
Atlassian logo

Mihai Buzgau (JIRA)

unread,
Feb 18, 2020, 7:44:05 AM2/18/20
to puppe...@googlegroups.com
Mihai Buzgau updated an issue
Change By: Mihai Buzgau
Component/s: Types and Providers

Mihai Buzgau (JIRA)

unread,
Feb 19, 2020, 6:12:06 AM2/19/20
to puppe...@googlegroups.com

Mihai Buzgau (JIRA)

unread,
Feb 19, 2020, 6:13:07 AM2/19/20
to puppe...@googlegroups.com
Mihai Buzgau updated an issue
Change By: Mihai Buzgau
Sprint: PR NW - Triage 2020-03-04

Mihai Buzgau (Jira)

unread,
Mar 5, 2020, 3:54:04 AM3/5/20
to puppe...@googlegroups.com
Mihai Buzgau updated an issue
Change By: Mihai Buzgau
Sprint: NW - 2020-03-04 , NW - 2020-03-17
This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)
Atlassian logo

Mihai Buzgau (Jira)

unread,
Mar 5, 2020, 3:55:04 AM3/5/20
to puppe...@googlegroups.com
Mihai Buzgau updated an issue
Change By: Mihai Buzgau
Sprint: NW PR - 2020-03-04 Triage , NW - 2020-03- 17 04

Gabriel Nagy (Jira)

unread,
Mar 18, 2020, 5:36:03 AM3/18/20
to puppe...@googlegroups.com

Mihai Buzgau (Jira)

unread,
Apr 8, 2020, 5:29:03 AM4/8/20
to puppe...@googlegroups.com
Mihai Buzgau updated an issue
Change By: Mihai Buzgau
Sprint: PR - Triage, NW - 2020-03-04 , NW - 2020-04-15

Ciprian Badescu (Jira)

unread,
Apr 13, 2020, 10:24:02 AM4/13/20
to puppe...@googlegroups.com

Mihai Buzgau (Jira)

unread,
Apr 15, 2020, 3:34:03 AM4/15/20
to puppe...@googlegroups.com
Mihai Buzgau updated an issue
Change By: Mihai Buzgau
Sprint: NW - 2020-03-04, NW - 2020-04-15 , NW - 2020-04-29

Gheorghe Popescu (Jira)

unread,
May 27, 2020, 5:52:03 AM5/27/20
to puppe...@googlegroups.com

Gheorghe Popescu (Jira)

unread,
May 27, 2020, 5:53:03 AM5/27/20
to puppe...@googlegroups.com
Gheorghe Popescu updated an issue
Change By: Gheorghe Popescu
Release Notes: Bug Fix Enhancement

Claire Cadman (Jira)

unread,
May 29, 2020, 4:25:03 AM5/29/20
to puppe...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages