@@ -82,7 +82,7 @@ def latest
82
82
83
83
if output =~ /^#{ resource [ :name ] } -(\d [^-]*)-?(\w *) \( installed\) $/
84
84
debug "Package is already the latest available"
85
- return properties [ :ensure ]
85
+ properties [ :ensure ]
86
86
else
87
87
match = /^(.*)-(\d [^-]*)-?(\w *)$/ . match ( output )
88
88
debug "Latest available for #{ resource [ :name ] } : #{ match [ 2 ] } "
@@ -91,7 +91,7 @@ def latest
91
91
return match [ 2 ]
92
92
end
93
93
94
- vcmp = properties [ :ensure ] . split ( '.' ) . map { | s | s . to_i } <=> match [ 2 ] . split ( '.' ) . map { | s | s . to_i }
94
+ vcmp = properties [ :ensure ] . split ( '.' ) . map { & : to_i } <=> match [ 2 ] . split ( '.' ) . map { & : to_i }
95
95
if vcmp > 0
96
96
# The locally installed package may actually be newer than what a mirror
97
97
# has. Log it at debug, but ignore it otherwise.
@@ -121,7 +121,6 @@ def install(latest = false)
121
121
# pkg_add(1) doesn't set the return value upon failure so we have to peek
122
122
# at it's output to see if something went wrong.
123
123
output = Puppet ::Util . withenv ( { } ) { pkgadd cmd . flatten . compact }
124
- require 'pp'
125
124
pp output
126
125
if output =~ /Can't find /
127
126
self . fail "pkg_add returned: #{ output . chomp } "
@@ -145,8 +144,8 @@ def get_full_name(latest = false)
145
144
end
146
145
"#{ resource [ :name ] } -#{ use_version } -#{ resource [ :flavor ] } "
147
146
elsif resource [ :name ] . to_s . match ( /[a-z0-9]%[0-9a-z]/i )
148
- "#{ resource [ :name ] } "
149
- elsif ! latest
147
+ "#{ resource [ :name ] } "
148
+ elsif !latest
150
149
"#{ resource [ :name ] } --"
151
150
else
152
151
# If :ensure contains a version, use that instead of looking it up.
@@ -168,7 +167,7 @@ def get_full_name(latest = false)
168
167
169
168
def get_version
170
169
pkg_search_name = @resource [ :name ]
171
- unless pkg_search_name . match ( /[a-z0-9]%[0-9a-z]/i ) and ! @resource [ :flavor ]
170
+ unless pkg_search_name . match ( /[a-z0-9]%[0-9a-z]/i ) and !@resource [ :flavor ]
172
171
# we are only called when no flavor is specified
173
172
# so append '--' to the :name to avoid patch versions on flavors
174
173
pkg_search_name << "--"
0 commit comments