# on the generated c code
#
-#
-##if defined(SWIGRUBY)
-# %rename("to_s") string();
-##endif
-##if defined(SWIGPYTHON)
-# %rename("__str__") string();
-##endif
-#
-
%module solv
#ifdef SWIGRUBY
Id type;
Id source;
Id target;
- Id dep;
+ Id dep_id;
} Ruleinfo;
typedef struct {
typedef struct {
Solver* const solv;
Id const type;
- Id const dep;
+ Id const dep_id;
} Ruleinfo;
typedef struct {
transaction_classify_pkgs($self->transaction, $self->mode, $self->type, $self->fromid, $self->toid, &q);
return q;
}
- %newobject fromdep;
- Dep *fromdep() {
- return new_Dep($self->transaction->pool, $self->fromid);
- }
- %newobject todep;
- Dep *todep() {
- return new_Dep($self->transaction->pool, $self->toid);
- }
+ const char * const fromstr;
+ const char * const tostr;
+ %{
+ SWIGINTERN const char *TransactionClass_fromstr_get(TransactionClass *cl) {
+ return pool_id2str(cl->transaction->pool, cl->fromid);
+ }
+ SWIGINTERN const char *TransactionClass_tostr_get(TransactionClass *cl) {
+ return pool_id2str(cl->transaction->pool, cl->toid);
+ }
+ %}
}
%extend XRule {
}
%extend Ruleinfo {
- Ruleinfo(XRule *r, Id type, Id source, Id target, Id dep) {
+ Ruleinfo(XRule *r, Id type, Id source, Id target, Id dep_id) {
Ruleinfo *ri = solv_calloc(1, sizeof(*ri));
ri->solv = r->solv;
ri->rid = r->id;
ri->type = type;
ri->source = source;
ri->target = target;
- ri->dep = dep;
+ ri->dep_id = dep_id;
return ri;
}
%newobject solvable;
XSolvable * const solvable;
%newobject othersolvable;
XSolvable * const othersolvable;
+ %newobject dep;
+ Dep * const dep;
%{
SWIGINTERN XSolvable *Ruleinfo_solvable_get(Ruleinfo *ri) {
return new_XSolvable(ri->solv->pool, ri->source);
SWIGINTERN XSolvable *Ruleinfo_othersolvable_get(Ruleinfo *ri) {
return new_XSolvable(ri->solv->pool, ri->target);
}
+ SWIGINTERN Dep *Ruleinfo_dep_get(Ruleinfo *ri) {
+ return new_Dep(ri->solv->pool, ri->dep_id);
+ }
%}
const char *problemstr() {
- return solver_problemruleinfo2str($self->solv, $self->type, $self->source, $self->target, $self->dep);
+ return solver_problemruleinfo2str($self->solv, $self->type, $self->source, $self->target, $self->dep_id);
}
}
The type of the ruleinfo. See the constant section of the solver class for the
rule type list and the special type list.
- Id dep; /* read only */
+ Dep *dep; /* read only */
$ruleinfo->{'dep'}
ruleinfo.dep
ruleinfo.dep
-The id of the dependency leading to the creation of the rule, or zero.
+The dependency leading to the creation of the rule.
+
+ Dep *dep_id; /* read only */
+ $ruleinfo->{'dep_id'}
+ ruleinfo.dep_id
+ ruleinfo.dep_id
+
+The Id of the dependency leading to the creation of the rule, or zero.
Solvable *solvable; /* read only */
$ruleinfo->{'solvable'}
The number of elements in the class.
+ const char *fromstr;
+ $class->{'fromstr'}
+ class.fromstr
+ class.fromstr
+
+The old vendor or architecture.
+
+ const char *tostr;
+ $class->{'tostr'}
+ class.tostr
+ class.tostr
+
+The new vendor or architecture.
+
Id fromid;
$class->{'fromid'}
class.fromid
Return the solvables for all transaction elements in the class.
- Dep *fromdep();
- my $from = $class->fromdep();
- from = class.fromdep();
- from = class.fromdep();
-
- Dep *todep();
- my $from = $class->todep();
- from = class.todep();
- from = class.todep();
-
-The id of the vendor or architecture in Dep object form.
-
CHECKSUMS
---------
Checksums (also called hashes) are used to make sure that downloaded data is
} elsif ($c->{'type'} == $solv::Transaction::SOLVER_TRANSACTION_UPGRADED) {
print "$c->{'count'} upgraded packages:\n";
} elsif ($c->{'type'} == $solv::Transaction::SOLVER_TRANSACTION_VENDORCHANGE) {
- printf "$c->{'count'} vendor changes from '%s' to '%s':\n", $c->fromdep()->str(), $c->todep()->str();
+ printf "$c->{'count'} vendor changes from '%s' to '%s':\n", $c->{'fromstr'}, $c->{'tostr'};
} elsif ($c->{'type'} == $solv::Transaction::SOLVER_TRANSACTION_ARCHCHANGE) {
- printf "$c->{'count'} arch changes from '%s' to '%s':\n", $c->fromdep()->str(), $c->todep()->str();
+ printf "$c->{'count'} arch changes from '%s' to '%s':\n", $c->{'fromstr'}->str(), $c->{'tostr'};
} else {
next;
}
}
print "Committing transaction:\n\n";
-$trans->order(0);
+$trans->order();
for my $p ($trans->steps()) {
my $steptype = $trans->steptype($p, $solv::Transaction::SOLVER_TRANSACTION_RPM_ONLY);
if ($steptype == $solv::Transaction::SOLVER_TRANSACTION_ERASE) {
elif cl.type == solv.Transaction.SOLVER_TRANSACTION_UPGRADED:
print "%d upgraded packages:" % cl.count
elif cl.type == solv.Transaction.SOLVER_TRANSACTION_VENDORCHANGE:
- print "%d vendor changes from '%s' to '%s':" % (cl.count, cl.fromdep(), cl.todep())
+ print "%d vendor changes from '%s' to '%s':" % (cl.count, cl.fromstr, cl.tostr)
elif cl.type == solv.Transaction.SOLVER_TRANSACTION_ARCHCHANGE:
- print "%d arch changes from '%s' to '%s':" % (cl.count, cl.fromdep(), cl.todep())
+ print "%d arch changes from '%s' to '%s':" % (cl.count, cl.fromstr, cl.tostr)
else:
continue
for p in cl.solvables():
elsif cl.type == Solv::Transaction::SOLVER_TRANSACTION_UPGRADED
puts "#{cl.count} upgraded packages:"
elsif cl.type == Solv::Transaction::SOLVER_TRANSACTION_VENDORCHANGE
- puts "#{cl.count} vendor changes from '#{cl.fromdep}' to '#{cl.todep}':"
+ puts "#{cl.count} vendor changes from '#{cl.fromstr}' to '#{cl.tostr}':"
elsif cl.type == Solv::Transaction::SOLVER_TRANSACTION_ARCHCHANGE
- puts "#{cl.count} arch changes from '#{cl.fromdep}' to '#{cl.todep}':"
+ puts "#{cl.count} arch changes from '#{cl.fromstr}' to '#{cl.tostr}':"
else
next
end
puts "Committing transaction:"
puts
-trans.order(0)
+trans.order()
for p in trans.steps
steptype = trans.steptype(p, Solv::Transaction::SOLVER_TRANSACTION_RPM_ONLY)
if steptype == Solv::Transaction::SOLVER_TRANSACTION_ERASE