ref: refs/heads/master
commit 9abdbc3c6ee67a0852425c3d8c593a8bebf1b399
Author: Michael Schroeder
Date: Fri May 15 18:44:13 2009 +0200
- oops, should use 'commit -a'...
---
applayer/CMakeLists.txt | 4 +-
applayer/decision.c | 2 +-
applayer/decision.h | 2 +-
applayer/job.c | 2 +-
applayer/job.h | 2 +-
applayer/problem.c | 14 ++++---
applayer/problem.h | 10 ++--
applayer/request.c | 44 ++++++++++----------
applayer/request.h | 34 +++++++-------
applayer/solution.c | 2 +-
applayer/solution.h | 2 +-
bindings/job.i | 4 +-
bindings/perl/tests/solver.pl | 4 +-
bindings/pool.i | 12 +++---
bindings/problem.i | 10 ++--
bindings/python/tests/pool.py | 2 +-
bindings/python/tests/solvable.py | 6 +-
bindings/request.i | 78 +++++++++++++++++-----------------
bindings/ruby/tests/CMakeLists.txt | 2 +-
bindings/ruby/tests/decisions.rb | 8 ++--
bindings/ruby/tests/installable.rb | 6 +-
bindings/ruby/tests/patch_updates.rb | 6 +-
bindings/ruby/tests/pool.rb | 2 +-
bindings/ruby/tests/problems.rb | 72 ++++++++++++++++----------------
bindings/ruby/tests/reasons.rb | 42 +++++++++---------
bindings/ruby/tests/request.rb | 28 ++++++------
bindings/ruby/tests/solutions.rb | 10 ++--
bindings/ruby/tests/solvable.rb | 6 +-
bindings/ruby/tests/solver.rb | 8 ++--
bindings/ruby/tests/updates.rb | 6 +-
bindings/rule.i | 2 +-
bindings/satsolver.i | 4 +-
bindings/solver.i | 40 +++++++++---------
33 files changed, 239 insertions(+), 237 deletions(-)
diff --git a/applayer/CMakeLists.txt b/applayer/CMakeLists.txt
index 3e2f6cb..ac6bfcb 100644
--- a/applayer/CMakeLists.txt
+++ b/applayer/CMakeLists.txt
@@ -5,12 +5,12 @@
ADD_SUBDIRECTORY(tests)
SET(libappsatsolver_SRCS job.c applayer.c covenant.c decision.c dependency.c
- kinds.c problem.c relation.c solution.c transaction.c xrepokey.c xsolvable.c)
+ kinds.c problem.c relation.c solution.c request.c xrepokey.c xsolvable.c)
ADD_LIBRARY(appsatsolver STATIC ${libappsatsolver_SRCS})
SET(libappsatsolver_HEADERS job.h applayer.h covenant.h decision.h dependency.h
- kinds.h problem.h relation.h solution.h transaction.h xrepokey.h xsolvable.h)
+ kinds.h problem.h relation.h solution.h request.h xrepokey.h xsolvable.h)
SET( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC -Wall -Werror" )
diff --git a/applayer/decision.c b/applayer/decision.c
index 8b6511f..413ae78 100644
--- a/applayer/decision.c
+++ b/applayer/decision.c
@@ -10,7 +10,7 @@
*
* A successful solver result.
*
- * Set of 'job items' needed to solve the Transaction.
+ * Set of 'job items' needed to solve the Request.
*
*/
diff --git a/applayer/decision.h b/applayer/decision.h
index 76fa550..6754863 100644
--- a/applayer/decision.h
+++ b/applayer/decision.h
@@ -13,7 +13,7 @@
*
* A successful solver result.
*
- * Set of 'job items' needed to solve the Transaction.
+ * Set of 'job items' needed to solve the Request.
*
*/
diff --git a/applayer/job.c b/applayer/job.c
index c52d08f..2590bd0 100644
--- a/applayer/job.c
+++ b/applayer/job.c
@@ -8,7 +8,7 @@
/*
* Job
*
- * A single 'job' item of a Transaction
+ * A single 'job' item of a Request
*
*/
diff --git a/applayer/job.h b/applayer/job.h
index 9d0fc03..bc7e5e7 100644
--- a/applayer/job.h
+++ b/applayer/job.h
@@ -8,7 +8,7 @@
/*
* Job
*
- * A single 'job' item of a Transaction
+ * A single 'job' item of a Request
*
*/
diff --git a/applayer/problem.c b/applayer/problem.c
index 16aa39a..9ab2434 100644
--- a/applayer/problem.c
+++ b/applayer/problem.c
@@ -10,7 +10,7 @@
*
* An unsuccessful solver result
*
- * If a transaction is not solvable, one or more
+ * If a request is not solvable, one or more
* Problems will be reported by the Solver.
*
*/
@@ -23,13 +23,13 @@
Problem *
-problem_new( Solver *s, Transaction *t, Id id )
+problem_new( Solver *s, Request *t, Id id )
{
Id prule;
Problem *p = (Problem *)malloc( sizeof( Problem ));
p->solver = s;
- p->transaction = t;
+ p->request = t;
p->id = id;
prule = solver_findproblemrule( s, id );
p->reason = solver_problemruleinfo( s, &(t->queue), prule, &(p->relation), &(p->source), &(p->target) );
@@ -44,7 +44,7 @@ problem_free( Problem *p )
void
-solver_problems_iterate( Solver *solver, Transaction *t, int (*callback)(const Problem *p, void *user_data), void *user_data )
+solver_problems_iterate( Solver *solver, Request *t, int (*callback)(const Problem *p, void *user_data), void *user_data )
{
Id problem = 0;
if (!callback)
@@ -84,9 +84,9 @@ problem_solutions_iterate( Problem *problem, int (*callback)( const Solution *s,
{
/* job, rp is index into job queue */
- what = problem->transaction->queue.elements[rp];
+ what = solver->job.elements[rp];
- switch (problem->transaction->queue.elements[rp - 1])
+ switch (solver->job.elements[rp - 1])
{
case SOLVER_INSTALL_SOLVABLE:
s1 = what;
@@ -141,6 +141,8 @@ problem_solutions_iterate( Problem *problem, int (*callback)( const Solution *s,
{
s1 = p;
s2 = rp;
+ if (p < 0)
+ p = rp;
/* policy, replace p with rp */
Solvable *sp = pool->solvables + p;
Solvable *sr = rp ? pool->solvables + rp : 0;
diff --git a/applayer/problem.h b/applayer/problem.h
index 42d0d78..bf1a94f 100644
--- a/applayer/problem.h
+++ b/applayer/problem.h
@@ -13,19 +13,19 @@
*
* An unsuccessful solver result
*
- * If a transaction is not solvable, one or more
+ * If a request is not solvable, one or more
* Problems will be reported by the Solver.
*
*/
#include "solver.h"
-#include "transaction.h"
+#include "request.h"
#include "solution.h"
typedef struct _Problem {
Solver *solver;
- Transaction *transaction;
+ Request *request;
Id id; /* [PRIVATE] problem id */
SolverProbleminfo reason;
Id source; /* solvable id */
@@ -33,10 +33,10 @@ typedef struct _Problem {
Id target; /* solvable id */
} Problem;
-Problem *problem_new( Solver *s, Transaction *t, Id id );
+Problem *problem_new( Solver *s, Request *t, Id id );
void problem_free( Problem *p );
-void solver_problems_iterate( Solver *solver, Transaction *t, int (*callback)( const Problem *p, void *user_data ), void *user_data );
+void solver_problems_iterate( Solver *solver, Request *t, int (*callback)( const Problem *p, void *user_data ), void *user_data );
void problem_solutions_iterate( Problem *p, int (*callback)( const Solution *s, void *user_data ), void *user_data );
#endif /* SATSOLVER_PROBLEM_H */
diff --git a/applayer/request.c b/applayer/request.c
index a2bf6b0..b82206f 100644
--- a/applayer/request.c
+++ b/applayer/request.c
@@ -6,7 +6,7 @@
*/
/************************************************
- * Transaction
+ * Request
*
* A set of Actions to be solved by the Solver
*
@@ -14,20 +14,20 @@
#include
-#include "transaction.h"
+#include "request.h"
-Transaction *
-transaction_new( Pool *pool )
+Request *
+request_new( Pool *pool )
{
- Transaction *t = (Transaction *)malloc( sizeof( Transaction ));
+ Request *t = (Request *)malloc( sizeof( Request ));
t->pool = pool;
queue_init( &(t->queue) );
return t;
}
void
-transaction_free( Transaction *t )
+request_free( Request *t )
{
queue_free( &(t->queue) );
free( t );
@@ -35,71 +35,71 @@ transaction_free( Transaction *t )
/*
- * number of actions in transaction
+ * number of actions in request
* every two queue elements make one action
*/
int
-transaction_size( Transaction *t )
+request_size( Request *t )
{
return t->queue.count >> 1;
}
void
-transaction_install_xsolvable( Transaction *t, XSolvable *xs )
+request_install_xsolvable( Request *t, XSolvable *xs )
{
- queue_push( &(t->queue), SOLVER_INSTALL_SOLVABLE );
+ queue_push( &(t->queue), SOLVER_INSTALL|SOLVER_SOLVABLE );
/* FIXME: check: s->repo->pool == $self->pool */
queue_push( &(t->queue), xs->id );
}
void
-transaction_remove_xsolvable( Transaction *t, XSolvable *xs )
+request_remove_xsolvable( Request *t, XSolvable *xs )
{
- queue_push( &(t->queue), SOLVER_ERASE_SOLVABLE );
+ queue_push( &(t->queue), SOLVER_ERASE|SOLVER_SOLVABLE );
/* FIXME: check: s->repo->pool == $self->pool */
queue_push( &(t->queue), xs->id );
}
void
-transaction_install_name( Transaction *t, const char *name )
+request_install_name( Request *t, const char *name )
{
- queue_push( &(t->queue), SOLVER_INSTALL_SOLVABLE_NAME );
+ queue_push( &(t->queue), SOLVER_INSTALL|SOLVER_SOLVABLE_NAME );
queue_push( &(t->queue), str2id( t->pool, name, 1 ));
}
void
-transaction_remove_name( Transaction *t, const char *name )
+request_remove_name( Request *t, const char *name )
{
- queue_push( &(t->queue), SOLVER_ERASE_SOLVABLE_NAME );
+ queue_push( &(t->queue), SOLVER_ERASE|SOLVER_SOLVABLE_NAME );
queue_push( &(t->queue), str2id( t->pool, name, 1 ));
}
void
-transaction_install_relation( Transaction *t, const Relation *rel )
+request_install_relation( Request *t, const Relation *rel )
{
- queue_push( &(t->queue), SOLVER_INSTALL_SOLVABLE_PROVIDES );
+ queue_push( &(t->queue), SOLVER_INSTALL|SOLVER_SOLVABLE_PROVIDES );
/* FIXME: check: rel->pool == $self->pool */
queue_push( &(t->queue), rel->id );
}
void
-transaction_remove_relation( Transaction *t, const Relation *rel )
+request_remove_relation( Request *t, const Relation *rel )
{
- queue_push( &(t->queue), SOLVER_ERASE_SOLVABLE_PROVIDES );
+ queue_push( &(t->queue), SOLVER_ERASE|SOLVER_SOLVABLE_PROVIDES );
/* FIXME: check: rel->pool == $self->pool */
queue_push( &(t->queue), rel->id );
}
Job *
-transaction_job_get( Transaction *t, int i )
+request_job_get( Request *t, int i )
{
int size, cmd;
Id id;
@@ -114,7 +114,7 @@ transaction_job_get( Transaction *t, int i )
void
-transaction_jobs_iterate( Transaction *t, int (*callback)( const Job *j))
+request_jobs_iterate( Request *t, int (*callback)( const Job *j))
{
int i;
for (i = 0; i < t->queue.count-1; )
diff --git a/applayer/request.h b/applayer/request.h
index 0a30642..777221e 100644
--- a/applayer/request.h
+++ b/applayer/request.h
@@ -6,36 +6,36 @@
*/
/************************************************
- * Transaction
+ * Request
*
* A set of Actions to be solved by the Solver
*
*/
-#ifndef SATSOLVER_TRANSACTION_H
-#define SATSOLVER_TRANSACTION_H
+#ifndef SATSOLVER_REQUEST_H
+#define SATSOLVER_REQUEST_H
#include "job.h"
-typedef struct _Transaction {
+typedef struct _Request {
Pool *pool;
Queue queue;
-} Transaction;
+} Request;
-Transaction *transaction_new( Pool *pool );
-void transaction_free( Transaction *t );
+Request *request_new( Pool *pool );
+void request_free( Request *t );
-void transaction_install_xsolvable( Transaction *t, XSolvable *xs );
-void transaction_remove_xsolvable( Transaction *t, XSolvable *xs );
-void transaction_install_name( Transaction *t, const char *name );
-void transaction_remove_name( Transaction *t, const char *name );
-void transaction_install_relation( Transaction *t, const Relation *rel );
-void transaction_remove_relation( Transaction *t, const Relation *rel );
-int transaction_size( Transaction *t );
-Job *transaction_job_get( Transaction *t, int i );
+void request_install_xsolvable( Request *t, XSolvable *xs );
+void request_remove_xsolvable( Request *t, XSolvable *xs );
+void request_install_name( Request *t, const char *name );
+void request_remove_name( Request *t, const char *name );
+void request_install_relation( Request *t, const Relation *rel );
+void request_remove_relation( Request *t, const Relation *rel );
+int request_size( Request *t );
+Job *request_job_get( Request *t, int i );
-void transaction_jobs_iterate( Transaction *t, int (*callback)( const Job *j));
+void request_jobs_iterate( Request *t, int (*callback)( const Job *j));
-#endif /* SATSOLVER_TRANSACTION_H */
+#endif /* SATSOLVER_REQUEST_H */
diff --git a/applayer/solution.c b/applayer/solution.c
index 2547637..7ab9cda 100644
--- a/applayer/solution.c
+++ b/applayer/solution.c
@@ -11,7 +11,7 @@
* A possible solution to a Problem.
*
* For each reported Problem, the Solver might generate
- * one or more Solutions to make the Transaction solvable.
+ * one or more Solutions to make the Request solvable.
*
*/
diff --git a/applayer/solution.h b/applayer/solution.h
index c0e7979..0a6d978 100644
--- a/applayer/solution.h
+++ b/applayer/solution.h
@@ -14,7 +14,7 @@
* A possible solution to a Problem.
*
* For each reported Problem, the Solver might generate
- * one or more Solutions to make the Transaction solvable.
+ * one or more Solutions to make the Request solvable.
*
*/
diff --git a/bindings/job.i b/bindings/job.i
index 7e1907a..79868f3 100644
--- a/bindings/job.i
+++ b/bindings/job.i
@@ -1,10 +1,10 @@
/*
* Document-class: Job
- * A job is a single 'work item' of a transaction
+ * A job is a single 'work item' of a request
*
* === Constructor
* There is no constructor defined for Job. Jobs are created by accessing
- * a Transaction
+ * a Request
*
*/
diff --git a/bindings/perl/tests/solver.pl b/bindings/perl/tests/solver.pl
index b16786f..6ccfd80 100755
--- a/bindings/perl/tests/solver.pl
+++ b/bindings/perl/tests/solver.pl
@@ -22,8 +22,8 @@ my $solver = $pool->create_solver();
# Create dependencies to provides table
$pool->prepare();
-# Create Transactions
-my $job = $pool->create_transaction();
+# Create Request
+my $job = $pool->create_request();
# Push jobs on Queue
my $pat = $pool->find("pattern:default") || die;
diff --git a/bindings/pool.i b/bindings/pool.i
index 07c52e5..dbf1121 100644
--- a/bindings/pool.i
+++ b/bindings/pool.i
@@ -752,18 +752,18 @@ typedef struct _Pool {} Pool;
#endif
/**************************
- * Transaction management
+ * Request management
*/
- %newobject create_transaction;
+ %newobject create_request;
/*
- * Create an empty Transaction.
+ * Create an empty Request
*
- * Equivalent to: Transaction.new
+ * Equivalent to: Request.new
*
*/
- Transaction *create_transaction()
- { return transaction_new( $self ); }
+ Request *create_request()
+ { return request_new( $self ); }
/**************************
* Solver management
diff --git a/bindings/problem.i b/bindings/problem.i
index f13a6ff..46b7a55 100644
--- a/bindings/problem.i
+++ b/bindings/problem.i
@@ -1,7 +1,7 @@
/*
* Document-class: Problem
*
- * If solving a Transaction is unsucccessful (+Solver+.+solve+ returning +false+), the Solver provides
+ * If solving a Request is unsucccessful (+Solver+.+solve+ returning +false+), the Solver provides
* information on possible reason and how to fix them.
*
* The Problem class represents such a reason and provides solutions.
@@ -38,7 +38,7 @@ typedef struct _Problem {} Problem;
%extend Problem {
/* The problem is caused by an update rule (i.e. 'better' Solvable available) */
%constant int SOLVER_PROBLEM_UPDATE_RULE = SOLVER_PROBLEM_UPDATE_RULE;
- /* The problem is caused by a Job inside the Transaction */
+ /* The problem is caused by a Job inside the Request */
%constant int SOLVER_PROBLEM_JOB_RULE = SOLVER_PROBLEM_JOB_RULE;
/* A Job based on a Relation could not be fulfilled because there is no Solvable in the Pool providing it. */
%constant int SOLVER_PROBLEM_JOB_NOTHING_PROVIDES_DEP = SOLVER_PROBLEM_JOB_NOTHING_PROVIDES_DEP;
@@ -69,10 +69,10 @@ typedef struct _Problem {} Problem;
{ return $self->solver; }
/*
- * The Transaction causing the Problem
+ * The Request causing the Problem
*/
- Transaction *transaction()
- { return $self->transaction; }
+ Request *request()
+ { return $self->request; }
/*
* The reason for the problem. One of +Satsolver::SOLVER_PROBLEM_*+
diff --git a/bindings/python/tests/pool.py b/bindings/python/tests/pool.py
index 0a38d7f..f105e45 100644
--- a/bindings/python/tests/pool.py
+++ b/bindings/python/tests/pool.py
@@ -4,7 +4,7 @@
# It contains all solvables, grouped by Repo(sitorie)s
# and is needed to create instances of other classes.
#
-# For Solvable, Repo, Transaction, Solver and Relation,
+# For Solvable, Repo, Request, Solver and Relation,
# Pool provides create_... methods as counterparts to
# the instance contructors, all requiring a Pool argument.
#
diff --git a/bindings/python/tests/solvable.py b/bindings/python/tests/solvable.py
index 4988d41..f972975 100644
--- a/bindings/python/tests/solvable.py
+++ b/bindings/python/tests/solvable.py
@@ -86,8 +86,8 @@ class TestSequenceFunctions(unittest.TestCase):
solv1.requires().add(rel)
assert solv1.requires().size() == 1
- transaction = self.pool.create_transaction()
- transaction.install( solv1 )
+ request = self.pool.create_request()
+ request.install( solv1 )
system = self.pool.create_repo( '@system' )
@@ -99,7 +99,7 @@ class TestSequenceFunctions(unittest.TestCase):
solver = self.pool.create_solver()
solver.set_allow_uninstall(True)
- res = solver.solve( transaction )
+ res = solver.solve( request )
assert res.__class__.__name__ == 'bool', res.__class__.__name__
assert res == True, res
for s in solver.installs():
diff --git a/bindings/request.i b/bindings/request.i
index 1ef2d9a..901db55 100644
--- a/bindings/request.i
+++ b/bindings/request.i
@@ -1,17 +1,17 @@
/*
- * Document-class: Transaction
- * Transaction represents a Set of Jobs as input for the Solver.
+ * Document-class: Request
+ * Request represents a Set of Jobs as input for the Solver.
*
*/
%{
/*
- * iterating over jobs of a transaction ('yield' in Ruby)
+ * iterating over jobs of a request ('yield' in Ruby)
*/
static int
-transaction_jobs_iterate_callback( const Job *j )
+request_jobs_iterate_callback( const Job *j )
{
#if defined(SWIGRUBY)
/* FIXME: how to pass 'break' back to the caller ? */
@@ -23,25 +23,25 @@ transaction_jobs_iterate_callback( const Job *j )
%}
-%nodefault _Transaction;
-%rename(Transaction) _Transaction;
-typedef struct _Transaction {} Transaction;
+%nodefault _Request;
+%rename(Request) _Request;
+typedef struct _Request {} Request;
#if defined(SWIGRUBY)
-%mixin Transaction "Enumerable";
+%mixin Request "Enumerable";
#endif
-%extend Transaction {
+%extend Request {
/*
- * Create transaction based on Pool
+ * Create request based on Pool
*
- * See also: Pool.create_transaction
+ * See also: Pool.create_request
*/
- Transaction( Pool *pool )
- { return transaction_new( pool ); }
+ Request( Pool *pool )
+ { return request_new( pool ); }
- ~Transaction()
- { transaction_free( $self ); }
+ ~Request()
+ { request_free( $self ); }
/*
* Install request
@@ -55,13 +55,13 @@ typedef struct _Transaction {} Transaction;
* solvable matching the request (by name, by relation)
*
* call-seq:
- * transaction.install(solvable) -> void
- * transaction.install("kernel") -> void
- * transaction.install(relation) -> void
+ * request.install(solvable) -> void
+ * request.install("kernel") -> void
+ * request.install(relation) -> void
*
*/
void install( XSolvable *xs )
- { transaction_install_xsolvable( $self, xs ); }
+ { request_install_xsolvable( $self, xs ); }
/*
* Remove request
@@ -75,40 +75,40 @@ typedef struct _Transaction {} Transaction;
* solvable matching the request (by name, by relation)
*
* call-seq:
- * transaction.remove(solvable) -> void
- * transaction.remove("kernel") -> void
- * transaction.remove(relation) -> void
+ * request.remove(solvable) -> void
+ * request.remove("kernel") -> void
+ * request.remove(relation) -> void
*
*/
void remove( XSolvable *xs )
- { transaction_remove_xsolvable( $self, xs ); }
+ { request_remove_xsolvable( $self, xs ); }
/*
* Install solvable by name
*/
void install( const char *name )
- { transaction_install_name( $self, name ); }
+ { request_install_name( $self, name ); }
/*
* Remove solvable by name
*
*/
void remove( const char *name )
- { transaction_remove_name( $self, name ); }
+ { request_remove_name( $self, name ); }
/*
* Install solvable by relation
*
*/
void install( const Relation *rel )
- { transaction_install_relation( $self, rel ); }
+ { request_install_relation( $self, rel ); }
/*
* Remove solvable by relation
*
*/
void remove( const Relation *rel )
- { return transaction_remove_relation( $self, rel ); }
+ { return request_remove_relation( $self, rel ); }
#if defined(SWIGRUBY)
%rename("empty?") empty();
@@ -116,30 +116,30 @@ typedef struct _Transaction {} Transaction;
"$result = $1 ? Qtrue : Qfalse;";
#endif
/*
- * Check if the transaction has any jobs attached.
+ * Check if the request has any jobs attached.
*
* call-seq:
- * transaction.empty? -> bool
+ * request.empty? -> bool
*
*/
int empty()
{ return ( $self->queue.count == 0 ); }
/*
- * Return number of jobs of this transaction
+ * Return number of jobs of this request
*
*/
int size()
- { return transaction_size( $self ); }
+ { return request_size( $self ); }
#if defined(SWIGRUBY)
%rename("clear!") clear();
#endif
/*
- * Remove all jobs of this transaction
+ * Remove all jobs of this request
*
* call-seq:
- * transaction.clear! -> void
+ * request.clear! -> void
*
*/
void clear()
@@ -154,23 +154,23 @@ typedef struct _Transaction {} Transaction;
* The index is just a convenience access method and
* does NOT imply any preference/ordering of the Jobs.
*
- * A Transaction is always considered a set of Jobs.
+ * A Request is always considered a set of Jobs.
*
* call-seq:
- * transaction.get(42) -> Job
+ * request.get(42) -> Job
*
*/
Job *get( unsigned int i )
- { return transaction_job_get( $self, i ); }
+ { return request_job_get( $self, i ); }
/*
- * Iterate over each Job of the Transaction.
+ * Iterate over each Job of the Request.
*
* call-seq:
- * transaction.each { |job| ... }
+ * request.each { |job| ... }
*
*/
void each()
- { transaction_jobs_iterate( $self, transaction_jobs_iterate_callback ); }
+ { request_jobs_iterate( $self, request_jobs_iterate_callback ); }
}
diff --git a/bindings/ruby/tests/CMakeLists.txt b/bindings/ruby/tests/CMakeLists.txt
index b4846ec..49e6561 100644
--- a/bindings/ruby/tests/CMakeLists.txt
+++ b/bindings/ruby/tests/CMakeLists.txt
@@ -15,7 +15,7 @@ ADD_TEST(bindings_ruby_repodata ruby -C ${CMAKE_CURRENT_SOURCE_DIR} repodata.
ADD_TEST(bindings_ruby_providers ruby -C ${CMAKE_CURRENT_SOURCE_DIR} providers.rb)
-ADD_TEST(bindings_ruby_transaction ruby -C ${CMAKE_CURRENT_SOURCE_DIR} transaction.rb)
+ADD_TEST(bindings_ruby_request ruby -C ${CMAKE_CURRENT_SOURCE_DIR} request.rb)
ADD_TEST(bindings_ruby_covenants ruby -C ${CMAKE_CURRENT_SOURCE_DIR} covenants.rb)
ADD_TEST(bindings_ruby_solver ruby -C ${CMAKE_CURRENT_SOURCE_DIR} solver.rb)
diff --git a/bindings/ruby/tests/decisions.rb b/bindings/ruby/tests/decisions.rb
index 793b648..4aec778 100644
--- a/bindings/ruby/tests/decisions.rb
+++ b/bindings/ruby/tests/decisions.rb
@@ -55,15 +55,15 @@ class DecisionTest < Test::Unit::TestCase
solv3.requires << Satsolver::Relation.new( pool, "A", Satsolver::REL_GT, "0.0-0" )
repo.create_solvable( 'DD', '4.4-0' )
- transaction = pool.create_transaction
- transaction.install( solv3 )
- transaction.remove( "D" )
+ request = pool.create_request
+ request.install( solv3 )
+ request.remove( "D" )
pool.installed = installed
solver = pool.create_solver( )
solver.allow_uninstall = true;
# @pool.debug = 255
- solver.solve( transaction )
+ solver.solve( request )
puts "** Problems found" if solver.problems?
assert solver.decision_count > 0
i = 0
diff --git a/bindings/ruby/tests/installable.rb b/bindings/ruby/tests/installable.rb
index 8dba24c..9413c16 100644
--- a/bindings/ruby/tests/installable.rb
+++ b/bindings/ruby/tests/installable.rb
@@ -35,10 +35,10 @@ end
pool.prepare
repo.each do |s|
- transaction = Satsolver::Transaction.new( pool )
- transaction.install( s )
+ request = Satsolver::Request.new( pool )
+ request.install( s )
solver = Satsolver::Solver.new( pool )
- res = solver.solve( transaction )
+ res = solver.solve( request )
$stderr.puts "Package #{s} is not installable" unless res
end
diff --git a/bindings/ruby/tests/patch_updates.rb b/bindings/ruby/tests/patch_updates.rb
index 3d16508..90bcb3d 100644
--- a/bindings/ruby/tests/patch_updates.rb
+++ b/bindings/ruby/tests/patch_updates.rb
@@ -18,7 +18,7 @@ solver.allow_uninstall = true
solver.fix_system = true
pool.prepare
-solver.solve( pool.create_transaction )
+solver.solve( pool.create_request )
removals = []
solver.each_to_remove { |s|
@@ -43,7 +43,7 @@ solver.allow_uninstall = true
solver.fix_system = true
pool.prepare
-solver.solve( pool.create_transaction )
+solver.solve( pool.create_request )
# these shouldn't print anything
@@ -68,7 +68,7 @@ solver.update_system = true
solver.fix_system = true
pool.prepare
-solver.solve( pool.create_transaction )
+solver.solve( pool.create_request )
#
# Now match updates to patches
diff --git a/bindings/ruby/tests/pool.rb b/bindings/ruby/tests/pool.rb
index fde6b05..3ca6160 100644
--- a/bindings/ruby/tests/pool.rb
+++ b/bindings/ruby/tests/pool.rb
@@ -4,7 +4,7 @@
# It contains all solvables, grouped by Repo(sitorie)s
# and is needed to create instances of other classes.
#
-# For Solvable, Repo, Transaction, Solver and Relation,
+# For Solvable, Repo, Request, Solver and Relation,
# Pool provides create_... methods as counterparts to
# the instance contructors, all requiring a Pool argument.
#
diff --git a/bindings/ruby/tests/problems.rb b/bindings/ruby/tests/problems.rb
index 8c0b50c..d2af244 100644
--- a/bindings/ruby/tests/problems.rb
+++ b/bindings/ruby/tests/problems.rb
@@ -47,12 +47,12 @@ require 'pathname'
require 'test/unit'
require 'satsolver'
-def solve_and_check solver, transaction, reason
+def solve_and_check solver, request, reason
# assert solver.problems?
i = 0
found = false
- solver.each_problem( transaction ) { |p|
+ solver.each_problem( request ) { |p|
found = true if p.reason == reason
i += 1
case p.reason
@@ -104,87 +104,87 @@ class ProblemTest < Test::Unit::TestCase
end
def test_update_rule
- transaction = @pool.create_transaction
+ request = @pool.create_request
@pool.installed = @installed
solver = @pool.create_solver( )
- solver.solve( transaction )
- assert solve_and_check( solver, transaction, Satsolver::SOLVER_PROBLEM_UPDATE_RULE )
+ solver.solve( request )
+ assert solve_and_check( solver, request, Satsolver::SOLVER_PROBLEM_UPDATE_RULE )
end
def test_job_rule
- transaction = @pool.create_transaction
+ request = @pool.create_request
@pool.installed = @installed
solver = @pool.create_solver( )
- solver.solve( transaction )
- assert solve_and_check( solver, transaction, Satsolver::SOLVER_PROBLEM_JOB_RULE )
+ solver.solve( request )
+ assert solve_and_check( solver, request, Satsolver::SOLVER_PROBLEM_JOB_RULE )
end
def test_job_nothing_provides
- transaction = @pool.create_transaction
+ request = @pool.create_request
@pool.installed = @installed
solver = @pool.create_solver( )
- solver.solve( transaction )
- assert solve_and_check( solver, transaction, Satsolver::SOLVER_PROBLEM_JOB_NOTHING_PROVIDES_DEP )
+ solver.solve( request )
+ assert solve_and_check( solver, request, Satsolver::SOLVER_PROBLEM_JOB_NOTHING_PROVIDES_DEP )
end
def test_not_installable
- transaction = @pool.create_transaction
+ request = @pool.create_request
solv = @pool.find( "A", @repo )
solv.requires << @pool.create_relation( "ZZ" )
- transaction.install( solv )
+ request.install( solv )
@pool.installed = @installed
solver = @pool.create_solver( )
- solver.solve( transaction )
- assert solve_and_check( solver, transaction, Satsolver::SOLVER_PROBLEM_NOT_INSTALLABLE )
+ solver.solve( request )
+ assert solve_and_check( solver, request, Satsolver::SOLVER_PROBLEM_NOT_INSTALLABLE )
end
def test_nothing_provides
- transaction = @pool.create_transaction
+ request = @pool.create_request
solvA = @pool.find( "A", @repo )
solvA.requires << @pool.create_relation( "B", Satsolver::REL_GE, "2.0-0" )
solvB = @pool.find( "B", @repo )
solvB.requires << @pool.create_relation( "ZZ" )
- transaction.install( solvA )
+ request.install( solvA )
@pool.installed = @installed
solver = @pool.create_solver( )
- solver.solve( transaction )
- assert solve_and_check( solver, transaction, Satsolver::SOLVER_PROBLEM_NOTHING_PROVIDES_DEP )
+ solver.solve( request )
+ assert solve_and_check( solver, request, Satsolver::SOLVER_PROBLEM_NOTHING_PROVIDES_DEP )
end
def test_same_name
- transaction = @pool.create_transaction
+ request = @pool.create_request
solvA = @pool.find( "A", @repo )
- transaction.install( solvA )
+ request.install( solvA )
solvA = @repo.create_solvable( "A", "2.0-0" )
- transaction.install( solvA )
+ request.install( solvA )
@pool.installed = @installed
solver = @pool.create_solver( )
- solver.solve( transaction )
- assert solve_and_check( solver, transaction, Satsolver::SOLVER_PROBLEM_SAME_NAME )
+ solver.solve( request )
+ assert solve_and_check( solver, request, Satsolver::SOLVER_PROBLEM_SAME_NAME )
end
def test_package_conflict
- transaction = @pool.create_transaction
+ request = @pool.create_request
solvA = @pool.find( "A", @repo )
solvB = @pool.find( "B", @repo )
solvA.conflicts << @pool.create_relation( solvB.name, Satsolver::REL_EQ, solvB.evr )
solvB.conflicts << @pool.create_relation( solvA.name, Satsolver::REL_EQ, solvA.evr )
- transaction.install( solvA )
- transaction.install( solvB )
+ request.install( solvA )
+ request.install( solvB )
@pool.installed = @installed
solver = @pool.create_solver( )
- solver.solve( transaction )
- assert solve_and_check( solver, transaction, Satsolver::SOLVER_PROBLEM_PACKAGE_CONFLICT )
+ solver.solve( request )
+ assert solve_and_check( solver, request, Satsolver::SOLVER_PROBLEM_PACKAGE_CONFLICT )
end
def test_package_obsoletes
- transaction = @pool.create_transaction
+ request = @pool.create_request
solvCC = @pool.find( "CC", @repo )
solvCC.obsoletes << @pool.create_relation( "A" )
- transaction.install( solvCC )
+ request.install( solvCC )
@pool.installed = @installed
solver = @pool.create_solver( )
- solver.solve( transaction )
- assert solve_and_check( solver, transaction, Satsolver::SOLVER_PROBLEM_PACKAGE_OBSOLETES )
+ solver.solve( request )
+ assert solve_and_check( solver, request, Satsolver::SOLVER_PROBLEM_PACKAGE_OBSOLETES )
end
def test_providers_not_installable
- transaction = @pool.create_transaction
+ request = @pool.create_request
@pool.installed = @installed
solver = @pool.create_solver( )
- solver.solve( transaction )
- assert solve_and_check( solver, transaction, Satsolver::SOLVER_PROBLEM_DEP_PROVIDERS_NOT_INSTALLABLE )
+ solver.solve( request )
+ assert solve_and_check( solver, request, Satsolver::SOLVER_PROBLEM_DEP_PROVIDERS_NOT_INSTALLABLE )
end
end
diff --git a/bindings/ruby/tests/reasons.rb b/bindings/ruby/tests/reasons.rb
index 6a1866f..3158deb 100644
--- a/bindings/ruby/tests/reasons.rb
+++ b/bindings/ruby/tests/reasons.rb
@@ -155,12 +155,12 @@ class ReasonsTest < Test::Unit::TestCase
puts "\n---\nB-1.0-0 requires A = 1.0-0"
- transaction = @pool.create_transaction
- transaction.install( solv2 )
+ request = @pool.create_request
+ request.install( solv2 )
@pool.prepare
solver = @pool.create_solver( )
- solver.solve( transaction )
+ solver.solve( request )
explain solver
end
@@ -175,12 +175,12 @@ class ReasonsTest < Test::Unit::TestCase
puts "\n---\nB-1.0-0 requires a = 42, provided by A-1.0-0"
- transaction = @pool.create_transaction
- transaction.install( solv2 )
+ request = @pool.create_request
+ request.install( solv2 )
@pool.prepare
solver = @pool.create_solver( )
- solver.solve( transaction )
+ solver.solve( request )
explain solver
end
@@ -197,12 +197,12 @@ class ReasonsTest < Test::Unit::TestCase
puts "\n---\nB-1.0-0 requires a = 42, provided by A-1.0-0 and C-1.0-0"
- transaction = @pool.create_transaction
- transaction.install( solv2 )
+ request = @pool.create_request
+ request.install( solv2 )
@pool.prepare
solver = @pool.create_solver( )
- solver.solve( transaction )
+ solver.solve( request )
explain solver
end
@@ -213,13 +213,13 @@ class ReasonsTest < Test::Unit::TestCase
repo.name = "beta5"
puts "\n---\nInstalling bash"
- transaction = @pool.create_transaction
- transaction.install( "bash" )
+ request = @pool.create_request
+ request.install( "bash" )
@pool.prepare
solver = @pool.create_solver( )
# solver.dont_install_recommended = true
- solver.solve( transaction )
+ solver.solve( request )
explain solver
end
@@ -238,12 +238,12 @@ class ReasonsTest < Test::Unit::TestCase
puts "\n---\nB-1.0-0 conflicts a = 42, provided by installed A-1.0-0"
- transaction = @pool.create_transaction
- transaction.install( solv2 )
+ request = @pool.create_request
+ request.install( solv2 )
@pool.prepare
solver = @pool.create_solver( )
- solver.solve( transaction )
+ solver.solve( request )
explain solver
end
@@ -260,12 +260,12 @@ class ReasonsTest < Test::Unit::TestCase
puts "\n---\n#{solv2} obsoletes #{rel}, provided by installed #{solv1}"
- transaction = @pool.create_transaction
- transaction.install( solv2 )
+ request = @pool.create_request
+ request.install( solv2 )
@pool.prepare
solver = @pool.create_solver( )
- solver.solve( transaction )
+ solver.solve( request )
explain solver
end
@@ -283,13 +283,13 @@ class ReasonsTest < Test::Unit::TestCase
@pool.installed = @repo
- transaction = @pool.create_transaction
- transaction.remove( solv1 )
+ request = @pool.create_request
+ request.remove( solv1 )
@pool.prepare
solver = @pool.create_solver( )
solver.allow_uninstall = true
- solver.solve( transaction )
+ solver.solve( request )
explain solver
end
diff --git a/bindings/ruby/tests/request.rb b/bindings/ruby/tests/request.rb
index 454572f..dc8eb01 100644
--- a/bindings/ruby/tests/request.rb
+++ b/bindings/ruby/tests/request.rb
@@ -6,8 +6,8 @@ require 'pathname'
require 'test/unit'
require 'satsolver'
-class TransactionTest < Test::Unit::TestCase
- def test_transaction
+class RequestTest < Test::Unit::TestCase
+ def test_request
pool = Satsolver::Pool.new
assert pool
pool.arch = "i686"
@@ -15,16 +15,16 @@ class TransactionTest < Test::Unit::TestCase
repo = pool.add_solv( solvpath )
repo.name = "test1"
- transaction = Satsolver::Transaction.new( pool )
- assert transaction
- transaction.install( "foo" )
- transaction.install( repo.find "ruby" )
- transaction.install( Satsolver::Relation.new( pool, "foo", Satsolver::REL_EQ, "42-7" ) )
- transaction.remove( "bar" )
- transaction.remove( repo.find "glibc" )
- transaction.remove( Satsolver::Relation.new( pool, "bar", Satsolver::REL_EQ, "42-7" ) )
- assert transaction.size == 6
- transaction.each { |a|
+ request = Satsolver::Request.new( pool )
+ assert request
+ request.install( "foo" )
+ request.install( repo.find "ruby" )
+ request.install( Satsolver::Relation.new( pool, "foo", Satsolver::REL_EQ, "42-7" ) )
+ request.remove( "bar" )
+ request.remove( repo.find "glibc" )
+ request.remove( Satsolver::Relation.new( pool, "bar", Satsolver::REL_EQ, "42-7" ) )
+ assert request.size == 6
+ request.each { |a|
cmd = case a.cmd
when Satsolver::INSTALL_SOLVABLE: "install #{a.solvable}"
when Satsolver::REMOVE_SOLVABLE: "remove #{a.solvable}"
@@ -36,7 +36,7 @@ class TransactionTest < Test::Unit::TestCase
end
puts cmd
}
- transaction.clear!
- assert transaction.empty?
+ request.clear!
+ assert request.empty?
end
end
diff --git a/bindings/ruby/tests/solutions.rb b/bindings/ruby/tests/solutions.rb
index 0feef22..72a693a 100644
--- a/bindings/ruby/tests/solutions.rb
+++ b/bindings/ruby/tests/solutions.rb
@@ -41,19 +41,19 @@ class SolutionTest < Test::Unit::TestCase
repo.create_solvable( 'DD', '4.4-0' )
- transaction = pool.create_transaction
- transaction.install( solv1 )
- transaction.remove( "Z" )
+ request = pool.create_request
+ request.install( solv1 )
+ request.remove( "Z" )
pool.installed = installed
solver = pool.create_solver( )
# solver.allow_uninstall = true;
# @pool.debug = 255
- solver.solve( transaction )
+ solver.solve( request )
assert solver.problems?
puts "Problems found"
i = 0
- solver.each_problem( transaction ) { |p|
+ solver.each_problem( request ) { |p|
i += 1
case p.reason
when Satsolver::SOLVER_PROBLEM_UPDATE_RULE
diff --git a/bindings/ruby/tests/solvable.rb b/bindings/ruby/tests/solvable.rb
index a82d0d7..7fa91ac 100644
--- a/bindings/ruby/tests/solvable.rb
+++ b/bindings/ruby/tests/solvable.rb
@@ -82,12 +82,12 @@ class SolvableTest < Test::Unit::TestCase
solv1.requires << rel
assert solv1.requires.size == 1
- transaction = @pool.create_transaction
- transaction.install( solv1 )
+ request = @pool.create_request
+ request.install( solv1 )
solver = @pool.create_solver( )
# @pool.debug = 255
- solver.solve( transaction )
+ solver.solve( request )
solver.each_to_install { |s|
puts "Install #{s}"
}
diff --git a/bindings/ruby/tests/solver.rb b/bindings/ruby/tests/solver.rb
index 104c573..fa96409 100644
--- a/bindings/ruby/tests/solver.rb
+++ b/bindings/ruby/tests/solver.rb
@@ -15,16 +15,16 @@ class SolverTest < Test::Unit::TestCase
repo = pool.add_solv( "../../../testsuite/data.libzypp/basic-exercises/exercise-1-packages.solv" )
repo.name = "test"
- transaction = Satsolver::Transaction.new( pool )
- transaction.install( "A" )
- transaction.remove( "xorg-x11" )
+ request = Satsolver::Request.new( pool )
+ request.install( "A" )
+ request.remove( "xorg-x11" )
pool.installed = system
solver = Satsolver::Solver.new( pool )
solver.allow_uninstall = true
assert solver.allow_uninstall
pool.prepare
- solver.solve( transaction )
+ solver.solve( request )
assert solver.sizechange
puts "Size change #{solver.sizechange}"
solver.each_to_install { |s|
diff --git a/bindings/ruby/tests/updates.rb b/bindings/ruby/tests/updates.rb
index 6a62211..af44dcb 100644
--- a/bindings/ruby/tests/updates.rb
+++ b/bindings/ruby/tests/updates.rb
@@ -17,7 +17,7 @@ solver.allow_uninstall = true
solver.fix_system = true
pool.prepare
-solver.solve( pool.create_transaction )
+solver.solve( pool.create_request )
removals = []
solver.each_to_remove { |s|
@@ -42,7 +42,7 @@ solver.allow_uninstall = true
solver.fix_system = true
pool.prepare
-solver.solve( pool.create_transaction )
+solver.solve( pool.create_request )
# these shouldn't print anything
@@ -67,7 +67,7 @@ solver.update_system = true
solver.fix_system = true
pool.prepare
-solver.solve( pool.create_transaction )
+solver.solve( pool.create_request )
count = 0
solver.each_to_install { |s|
diff --git a/bindings/rule.i b/bindings/rule.i
index 858cc16..f63e7c3 100644
--- a/bindings/rule.i
+++ b/bindings/rule.i
@@ -2,7 +2,7 @@
* Document-class: Rule
*
* A rule is the internal representation of the _working_ _queue_ of the
- * solver. Each transaction item and each dependency is converted to a
+ * solver. Each job item and each dependency is converted to a
* rule the solver operates on.
*
* Rules are useful to traceback a decision or a problem.
diff --git a/bindings/satsolver.i b/bindings/satsolver.i
index 1afb04e..92178a0 100644
--- a/bindings/satsolver.i
+++ b/bindings/satsolver.i
@@ -152,7 +152,7 @@ SWIGINTERNINLINE SV *SWIG_FromCharPtr(const char *cptr);
#include "relation.h"
#include "dependency.h"
#include "job.h"
-#include "transaction.h"
+#include "request.h"
#include "decision.h"
#include "problem.h"
#include "solution.h"
@@ -403,7 +403,7 @@ typedef unsigned int Offset;
%include "dependency.i"
%include "solvable.i"
%include "job.i"
-%include "transaction.i"
+%include "request.i"
%include "decision.i"
%include "problem.i"
%include "solution.i"
diff --git a/bindings/solver.i b/bindings/solver.i
index 33f9e70..2a9fd5b 100644
--- a/bindings/solver.i
+++ b/bindings/solver.i
@@ -8,7 +8,7 @@
* solver can operate on. The pool also has designated repository for
* 'installed' solvables.
*
- * Solving is done by creating Transactions and feeding them to the
+ * Solving is done by creating a Request and feeding it to the
* solver as input. On success (solver.solve() returning 'true'), one can
* retrieve the Decisions made by the solver (i.e. install this, remove
* that, update those). On failure, the solver creates a list of
@@ -24,17 +24,17 @@
* pool.installed = system
* repo = pool.add_solv( "myrepo.solv" )
*
- * transaction = pool.create_transaction
- * transaction.install( "packageA" )
- * transaction.install( "packageB" )
- * transaction.remove( "old_package" )
+ * request = pool.create_request
+ * request.install( "packageA" )
+ * request.install( "packageB" )
+ * request.remove( "old_package" )
*
* solver = pool.create_solver
* solver.allow_uninstall = true
* pool.prepare
- * result = solver.solve( transaction )
+ * result = solver.solve( request )
* if !result
- * raise "Couldn't solve transaction"
+ * raise "Couldn't solve request"
* end
*
* solver.each_to_install do |s|
@@ -157,7 +157,7 @@ typedef struct solver {} Solver;
* The normal solver operation tries to install (to update to) the 'best' package,
* usually the one with the highest version.
* If allow_downgrade is set, packages may be downgraded in order to
- * fulfill a transaction or a dependency
+ * fulfill a request or a dependency
* call-seq:
* solver.allow_downgrade -> bool
*
@@ -250,9 +250,9 @@ typedef struct solver {} Solver;
/*
* On package removal, also remove dependant packages.
*
- * If removal of a package breaks dependencies, the transaction is
+ * If removal of a package breaks dependencies, the request is
* usually considered not solvable. The dependencies of installed
- * packages take precedence over transaction actions.
+ * packages take precedence over request actions.
*
*
* call-seq:
@@ -791,15 +791,15 @@ typedef struct solver {} Solver;
}
#endif
/*
- * Solve the given Transaction
+ * Solve the given Request
*
* Returns +true+ if a solution was found, else +false+.
*
* call-seq:
- * solver.solve(transaction) -> bool
+ * solver.solve(request) -> bool
*
*/
- int solve( Transaction *t )
+ int solve( Request *t )
{
if ($self->covenantq.count) {
/* FIXME: Honor covenants */
@@ -811,11 +811,11 @@ typedef struct solver {} Solver;
/*
* Return the number of decisions after solving.
*
- * If its >0, a solution of the Transaction was found.
+ * If its >0, a solution of the Request was found.
*
- * If its ==0, and 'Solver.problems?' returns +true+, the Transaction couldn't be solved.
+ * If its ==0, and 'Solver.problems?' returns +true+, the Request couldn't be solved.
*
- * If its ==0, and 'Solver.problems?' returns +false+, the Transaction is trivially solved.
+ * If its ==0, and 'Solver.problems?' returns +false+, the Request is trivially solved.
*
* call-seq:
* solver.decision_count -> int
@@ -865,10 +865,10 @@ typedef struct solver {} Solver;
* *OBSOLETE*: Use Decision.explain instead
*
* call-seq:
- * solver.explain(transaction, decision) -> [, Relation, Solvable, Solvable]
+ * solver.explain(request, decision) -> [, Relation, Solvable, Solvable]
*
*/
- __type explain(Transaction *unused, Decision *decision)
+ __type explain(Request *unused, Decision *decision)
{
Swig_Type result = Swig_Null;
Id rule = decision->rule - $self->rules;
@@ -911,10 +911,10 @@ typedef struct solver {} Solver;
* Iterate over problems.
*
* call-seq:
- * solver.each_problem(transaction) { |problem| ... }
+ * solver.each_problem(request) { |problem| ... }
*
*/
- void each_problem( Transaction *t )
+ void each_problem( Request *t )
{ return solver_problems_iterate( $self, t, solver_problems_iterate_callback, NULL ); }
/*
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org
For additional commands, e-mail: zypp-commit+help@opensuse.org