Debian control generation and versions #410

Closed
JGiard opened this Issue Apr 11, 2013 · 2 comments

Projects

None yet

3 participants

@JGiard

When generating debian packages, specifying a max or min version in a conflicts clause breaks the control file validity as parenthesis are not appended around the version specification.

ex : building the following package (fpm 0.4.33) :
fpm -s dir -t deb --name some-package --version 1.0 --iteration 0 --description Description --conflicts "test-package <= 1.2" test

generates the following Conflicts clause :
Conflicts: test-package <= 1.2

which produces the following error at install (dpkg 1.15.8.12 on squeeze) :
parse error, in file '/var/lib/dpkg/tmp.ci/control' near line 8 package 'some-package':
Conflicts' field, syntax error after reference to packagetest-package'

I managed to solve it with the following patch :
--- a/templates/deb.erb
+++ b/templates/deb.erb
@@ -9,7 +9,7 @@ Installed-Size: <%= attributes[:deb_installed_size] %>
Depends: <%= dependencies.collect { |d| fix_dependency(d) }.flatten.join(", ") %>
<% end -%>
<% if !conflicts.empty? -%>
-Conflicts: <%= conflicts.join(", ") %>
+Conflicts: <%= conflicts.collect { |d| fix_dependency(d) }.flatten.join(", ") %>
<% end -%>
<% if attributes[:deb_breaks] -%>
Breaks: <%= attributes[:deb_breaks].join(", ") %>

Please note that this might also happens on Breaks clause.

@jordansissel

Ahh! Good catch.

@jordansissel jordansissel added a commit that referenced this issue Apr 11, 2013
@jordansissel - fix_dependency on Conflicts and Breaks (#410)
- add test coverage for #410
94cd1af
@r4um
Collaborator

Fixed in 0.4.34 and above.

@r4um r4um closed this May 9, 2013
@prof-milki prof-milki pushed a commit to prof-milki/xpm that referenced this issue Dec 18, 2014
jls - fix_dependency on Conflicts and Breaks (#410)
- add test coverage for #410
1d45b75
@prof-milki prof-milki pushed a commit to prof-milki/xpm that referenced this issue Dec 27, 2014
@jordansissel - fix_dependency on Conflicts and Breaks (#410)
- add test coverage for #410
43d25c8
@jordansissel jordansissel added a commit that referenced this issue Apr 24, 2015
@jordansissel - fix_dependency on Conflicts and Breaks (#410)
- add test coverage for #410
5a0b9d1
@jordansissel jordansissel added a commit that referenced this issue Jun 20, 2016
@jordansissel - fix_dependency on Conflicts and Breaks (#410)
- add test coverage for #410
79c2f8e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment