Skip to content

Commit 5b8dae4

Browse files
committed
Add ability to specify replace-pkgs with an empty version
1 parent fe035de commit 5b8dae4

File tree

1 file changed

+16
-6
lines changed
  • resources/puppetlabs/lein-ezbake/template/global/ext

1 file changed

+16
-6
lines changed

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

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -352,14 +352,24 @@
352352

353353
options.replaces.each do |pkg, version|
354354
if options.output_type == 'rpm'
355-
fpm_opts << "--replaces '#{pkg} <= #{version}-1'"
356-
fpm_opts << "--conflicts '#{pkg} <= #{version}-1'"
355+
val = if version.nil? || version.empty?
356+
"'#{pkg}'"
357+
else
358+
"'#{pkg} <= #{version}-1'"
359+
end
360+
fpm_opts << "--replaces #{val}"
361+
fpm_opts << "--conflicts #{val}"
357362
elsif options.output_type == 'deb'
358363
# why debian, why.
359-
fpm_opts << "--replaces '#{pkg} (<< #{version}-1openvox1)'"
360-
fpm_opts << "--conflicts '#{pkg} (<< #{version}-1openvox1)'"
361-
fpm_opts << "--replaces '#{pkg} (<< #{version}-1#{options.dist})'"
362-
fpm_opts << "--conflicts '#{pkg} (<< #{version}-1#{options.dist})'"
364+
if version.nil? || version.empty?
365+
fpm_opts << "--replaces '#{pkg}'"
366+
fpm_opts << "--conflicts '#{pkg}'"
367+
else
368+
fpm_opts << "--replaces '#{pkg} (<< #{version}-1openvox1)'"
369+
fpm_opts << "--conflicts '#{pkg} (<< #{version}-1openvox1)'"
370+
fpm_opts << "--replaces '#{pkg} (<< #{version}-1#{options.dist})'"
371+
fpm_opts << "--conflicts '#{pkg} (<< #{version}-1#{options.dist})'"
372+
end
363373
end
364374
end
365375

0 commit comments

Comments
 (0)