Skip to content

Commit 24d0e7b

Browse files
committed
test
1 parent 69d87d6 commit 24d0e7b

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

resources/puppetlabs/lein-ezbake/template/global/controller.sh.erb

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,14 @@ fi
152152
params+=('--logrotate')
153153
<% end -%>
154154

155-
<% EZBake::Config[:replaces_pkgs].each do |package, version| -%>
155+
# In this part, we should really be fixing the use of as-ruby-literal
156+
# rather than messing with quotes here. But someone more familiar with
157+
# Clojure than I can do that.
158+
#<% EZBake::Config[:replaces_pkgs].each do |package, version| -%>
159+
#<% munged_package = package.delete_prefix("'").delete_suffix("'") %>
160+
#<% munged_version = version.nil? ? '' : version.delete_prefix("'").delete_suffix("'") %>
161+
#<% replaces_str = munged_version.empty? ? "#{munged_package}" : "#{munged_package} #{munged_version}" %>
162+
#params+=('--replaces' "<%= replaces_str -%>")
156163
params+=('--replaces' "<%= package -%>,<%= version -%>")
157164
<% end %>
158165

resources/puppetlabs/lein-ezbake/template/global/ext/fpm.rb

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -350,8 +350,12 @@
350350
shared_opts << "--url http://github.com/openvoxproject"
351351
shared_opts << "--architecture all"
352352

353-
puts "######## Replaces: #{options.replaces}"
354353
options.replaces.each do |pkg, version|
354+
# Strip the surrounding quotes since we add them in a certain way here.
355+
# We should probably just fix this in the core code by being smarter with
356+
# as-ruby-literaly, but someone more familiar with Clojure can do that part.
357+
pkg = pkg.delete_prefix("'").delete_suffix("'")
358+
version = version.delete_prefix("'").delete_suffix("'") unless version.nil?
355359
if options.output_type == 'rpm'
356360
val = if version.nil? || version.empty?
357361
"'#{pkg}'"
@@ -366,8 +370,10 @@
366370
fpm_opts << "--replaces '#{pkg}'"
367371
fpm_opts << "--conflicts '#{pkg}'"
368372
else
369-
fpm_opts << "--replaces '#{pkg} (<< #{version}-1openvox1)'"
370-
fpm_opts << "--conflicts '#{pkg} (<< #{version}-1openvox1)'"
373+
fpm_opts << "--replaces '#{pkg} (<< #{version}-1voxpupuli1)'"
374+
fpm_opts << "--conflicts '#{pkg} (<< #{version}-1voxpupuli1)'"
375+
fpm_opts << "--replaces '#{pkg} (<< #{version}-1puppetlabs1)'"
376+
fpm_opts << "--conflicts '#{pkg} (<< #{version}-1puppetlabs1)'"
371377
fpm_opts << "--replaces '#{pkg} (<< #{version}-1#{options.dist})'"
372378
fpm_opts << "--conflicts '#{pkg} (<< #{version}-1#{options.dist})'"
373379
end

0 commit comments

Comments
 (0)