[zypp-commit] r9066 - /trunk/sat-solver/testsuite/deptestomatic.c
Author: matz Date: Mon Mar 10 10:27:21 2008 New Revision: 9066 URL: http://svn.opensuse.org/viewcvs/zypp?rev=9066&view=rev Log: Make deptestomatic search for the exact release requested, before ignoring it. 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=9066&r1=9065&r2=9066&view=diff ============================================================================== --- trunk/sat-solver/testsuite/deptestomatic.c (original) +++ trunk/sat-solver/testsuite/deptestomatic.c Mon Mar 10 10:27:21 2008 @@ -660,7 +660,7 @@ // static Id -select_solvable( Pool *pool, Repo *repo, const char *name, const char *version, const char *arch ) +select_solvable( Pool *pool, Repo *repo, const char *name, const char *version, const char *arch, const char *release ) { Solvable *s; Id id, archid; @@ -690,7 +690,12 @@ continue; if (archid && s->arch != archid) continue; - if (version) + if (version && release && *release) + { + if (evrmatch(pool, s->evr, 0, version, release)) + continue; + } + else if (version) { const char *sver = id2str(pool, s->evr); const char *svere = strrchr(sver, '-'); @@ -701,6 +706,10 @@ } return i; } + /* Fallback code for inconsistent testcase which require non-existent + releases. */ + if (release && *release) + return select_solvable(pool, repo, name, version, arch, 0); return ID_NULL; } @@ -1038,7 +1047,7 @@ } if (repo) { - Id id = select_solvable( pool, repo, package, version, arch ); + Id id = select_solvable( pool, repo, package, version, arch, 0 ); if (id == ID_NULL) { err( "Install: Package '%s' not found", package ); @@ -1050,7 +1059,7 @@ } else /* no channel given, lock installed */ { - Id id = select_solvable( pool, pd->system, package, version, arch ); + Id id = select_solvable( pool, pd->system, package, version, arch, 0 ); queue_push( &(pd->trials), SOLVER_INSTALL_SOLVABLE ); queue_push( &(pd->trials), id ); } @@ -1096,6 +1105,7 @@ const char *channel = attrval( atts, "channel" ); const char *arch = attrval( atts, "arch" ); const char *version = attrval( atts, "version" ); + const char *release = attrval( atts, "release" ); char package[MAXNAMELEN]; getPackageName( atts, package ); @@ -1124,7 +1134,7 @@ } ++i; } - Id id = select_solvable( pool, repo, package, version, arch ); + Id id = select_solvable( pool, repo, package, version, arch, release ); if (id == ID_NULL) { err( "Install: Package '%s' not found", package ); @@ -1134,6 +1144,12 @@ queue_push( &(pd->trials), SOLVER_INSTALL_SOLVABLE ); queue_push( &(pd->trials), id ); } + else if (version) + { + Id id = select_solvable( pool, 0, package, version, arch, release); + queue_push( &(pd->trials), SOLVER_INSTALL_SOLVABLE ); + queue_push( &(pd->trials), id ); + } else /* no channel given, from any channel */ { Id id = str2id( pool, package, 1 ); @@ -1158,7 +1174,7 @@ err( "No system channel defined to <uninstall> from" ); exit( 1 ); } - Id id = select_solvable( pool, pd->system, package, 0, 0 ); + Id id = select_solvable( pool, pd->system, package, 0, 0, 0 ); if (id == ID_NULL) { err( "Remove: Package '%s' is not installed", package ); @@ -1250,7 +1266,7 @@ err( "No package given in <keep>" ); exit( 1 ); } - Id id = select_solvable( pool, pd->system, package, version, arch ); + Id id = select_solvable( pool, pd->system, package, version, arch, 0 ); queue_push( &(pd->trials), SOLVER_INSTALL_SOLVABLE ); queue_push( &(pd->trials), id ); } -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org
participants (1)
-
matz@svn.opensuse.org