Skip to content

Conversation

@voxik
Copy link
Member

@voxik voxik commented Jan 6, 2026

This implements support for boolean RPM dependencies [1], which are available with RPM 4.14+. This allow to use only single line per dependency:

dep = Gem::Dependency.new('pessimistic_constraint', Gem::Requirement.new('~> 1.0'))
list = Gem2Rpm::RpmDependencyList.new([dep])

puts list.virtualize.booleanize.with_requires.to_rpm
# => Requires: (rubygem(pessimistic_constraint) >= 1.0 with rubygem(pessimistic_constraint) < 2)

While previously, this was the only option:

puts list.virtualize.with_requires.to_rpm
# => Requires: rubygem(pessimistic_constraint) >= 1.0
#    Requires: rubygem(pessimistic_constraint) < 2

Fixes #123
Fixes #124

This implements support for boolean RPM dependencies [[1]], which are
available with RPM 4.14+. This allow to use only single line per
dependency:

~~~ruby
dep = Gem::Dependency.new('pessimistic_constraint', Gem::Requirement.new('~> 1.0'))
list = Gem2Rpm::RpmDependencyList.new([dep])

puts list.virtualize.booleanize.with_requires.to_rpm
# => Requires: (rubygem(pessimistic_constraint) >= 1.0 with rubygem(pessimistic_constraint) < 2)
~~~

While previously, this was the only option:

~~~ruby
puts list.virtualize.with_requires.to_rpm
# => Requires: rubygem(pessimistic_constraint) >= 1.0
#    Requires: rubygem(pessimistic_constraint) < 2
~~~

Fixes fedora-ruby#123
Fixes fedora-ruby#124

[1]: https://rpm-software-management.github.io/rpm/manual/boolean_dependencies.html
@voxik voxik merged commit b8b9a22 into fedora-ruby:master Jan 7, 2026
14 checks passed
@voxik voxik deleted the boolean_rpm_dep branch January 7, 2026 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant