Mailinglist Archive: zypp-commit (223 mails)

< Previous Next >
[zypp-commit] r10639 - /trunk/sat-solver/testsuite/deptestomatic.c
  • From: mlschroe@xxxxxxxxxxxxxxxx
  • Date: Tue, 22 Jul 2008 13:12:35 -0000
  • Message-id: <20080722131235.D81542A1A0@xxxxxxxxxxxxxxxx>
Author: mlschroe
Date: Tue Jul 22 15:12:35 2008
New Revision: 10639

URL: http://svn.opensuse.org/viewcvs/zypp?rev=10639&view=rev
Log:
- support addRequire with rels (yuck!)

Modified:
trunk/sat-solver/testsuite/deptestomatic.c

Modified: trunk/sat-solver/testsuite/deptestomatic.c
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/testsuite/deptestomatic.c?rev=10639&r1=10638&r2=10639&view=diff
==============================================================================
--- trunk/sat-solver/testsuite/deptestomatic.c (original)
+++ trunk/sat-solver/testsuite/deptestomatic.c Tue Jul 22 15:12:35 2008
@@ -1271,12 +1271,46 @@

case STATE_ADDREQUIRE: {
const char *name = attrval( atts, "name" );
+ Id id;
if (name == NULL) {
err( "No name given in <addrequire>" );
exit( 1 );
}
+ if (strchr(name, ' ')) {
+ char *n = strdup(name);
+ char *rel;
+ char *evr;
+ int flags = 0;
+
+ rel = strchr(n, ' ');
+ *rel++ = 0;
+ while (*rel == ' ')
+ rel++;
+ evr = strchr(rel, ' ');
+ if (!evr)
+ {
+ err( "No evr in addrequire dep" );
+ exit( 1 );
+ }
+ *evr++ = 0;
+ while (*evr == ' ')
+ evr++;
+ if (!strcmp(rel, "="))
+ flags = REL_EQ;
+ else if (!strcmp(rel, ">"))
+ flags = REL_GT;
+ else
+ {
+ err( "unknown rel in addrequire dep" );
+ exit( 1 );
+ }
+ id = str2id( pd->pool, n, 1);
+ id = rel2id( pd->pool, id, str2id(pd->pool, evr, 1), flags, 1);
+ } else {
+ id = str2id( pd->pool, name, 1 );
+ }
queue_push( &(pd->trials), SOLVER_INSTALL_SOLVABLE_PROVIDES );
- queue_push( &(pd->trials), str2id( pd->pool, name, 1 ) );
+ queue_push( &(pd->trials), id );
}
break;


--
To unsubscribe, e-mail: zypp-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: zypp-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages