@@ -30,7 +30,7 @@ def self.instances
3030 begin
3131 execpipe ( listcmd ) do |process |
3232 # our regex for matching pkg_info output
33- regex = /^(.*)-(\d [^-]*)[-] ?([\w -]*)(.*)$/
33+ regex = /^(.*)-(\d [^-]*)- ?([\w -]*)(.*)$/
3434 fields = [ :name , :ensure , :flavor ]
3535 hash = { }
3636
@@ -89,15 +89,15 @@ def latest
8989 return version
9090 else
9191 # Remove all fuzzy matches first.
92- output = output . split . select { |p | p =~ /^#{ resource [ :name ] } -(\d [^-]*)[-] ?(\w *)/ } . join
92+ output = output . split . select { |p | p =~ /^#{ resource [ :name ] } -(\d [^-]*)- ?(\w *)/ } . join
9393 debug "pkg_info -Q for #{ resource [ :name ] } : #{ output } "
9494 end
9595
96- if output =~ /^#{ resource [ :name ] } -(\d [^-]*)[-] ?(\w *) \( installed\) $/
96+ if output =~ /^#{ resource [ :name ] } -(\d [^-]*)- ?(\w *) \( installed\) $/
9797 debug "Package is already the latest available"
9898 return version
9999 else
100- match = /^(.*)-(\d [^-]*)[-] ?(\w *)$/ . match ( output )
100+ match = /^(.*)-(\d [^-]*)- ?(\w *)$/ . match ( output )
101101 debug "Latest available for #{ resource [ :name ] } : #{ match [ 2 ] } "
102102
103103 if version . to_sym == :absent || version . to_sym == :purged
@@ -201,7 +201,7 @@ def get_full_name(latest = false)
201201 def get_version
202202 execpipe ( [ command ( :pkginfo ) , "-I" , @resource [ :name ] ] ) do |process |
203203 # our regex for matching pkg_info output
204- regex = /^(.*)-(\d [^-]*)[-] ?(\w *)(.*)$/
204+ regex = /^(.*)-(\d [^-]*)- ?(\w *)(.*)$/
205205 master_version = 0
206206 version = -1
207207
0 commit comments