Mailinglist Archive: zypp-devel (70 mails)
| < Previous | Next > |
Re: [zypp-devel] Re: sat solver enhancements and questions
- From: Klaus Kaempf <kkaempf@xxxxxxx>
- Date: Fri, 26 Oct 2007 16:10:03 +0200
- Message-id: <20071026141002.GA21457@xxxxxxxxxxxxx>
* Duncan Mac-Vicar Prett <dmacvicar@xxxxxxx> [Oct 26. 2007 16:01]:
I wonder if the transaction (input), the result (output) and the
solver (function) shouldn't be separate.
Something like
result = solver.solve( transaction )
and then
result.each ...
result.install.each ...
result.update.each ...
result.remove.each ...
I'd prefer to hide the queue from the API and have a 'transaction'
object with named transactional methods:
transaction.install( r )
transaction.install_name( "foo" )
transaction.require( "libfoo.so" )
Bottom line: The API should represent the solver semantics, not its
implementation.
Klaus
--
To unsubscribe, e-mail: zypp-devel+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: zypp-devel+help@xxxxxxxxxxxx
ok I just commited everything, and I got the solver results iterators working:
solv.solve(q)
solv.each_to_install do |i|
puts "to install #{i}"
end
solv.each_to_remove do |i|
puts "to remove #{i}"
end
I wonder if the transaction (input), the result (output) and the
solver (function) shouldn't be separate.
Something like
result = solver.solve( transaction )
and then
result.each ...
result.install.each ...
result.update.each ...
result.remove.each ...
Michael (matz), with your sugestion about the queue api? how should it look
like? Do you mean replace:
q.push(SOLVER_INSTALL_SOLVABLE)
q.push(r)
with q.push_install(r), or q.push(r, :install)
or?
I'd prefer to hide the queue from the API and have a 'transaction'
object with named transactional methods:
transaction.install( r )
transaction.install_name( "foo" )
transaction.require( "libfoo.so" )
Bottom line: The API should represent the solver semantics, not its
implementation.
Klaus
--
To unsubscribe, e-mail: zypp-devel+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: zypp-devel+help@xxxxxxxxxxxx
| < Previous | Next > |