Author: mlschroe Date: Tue Oct 23 14:40:00 2007 New Revision: 7606 URL: http://svn.opensuse.org/viewcvs/zypp?rev=7606&view=rev Log: - map locale(xx) to language:xx to be compatible to libzypp - treat system:modalias() as modalias() Modified: trunk/sat-solver/src/source.c Modified: trunk/sat-solver/src/source.c URL: http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/src/source.c?rev=7606&... ============================================================================== --- trunk/sat-solver/src/source.c (original) +++ trunk/sat-solver/src/source.c Tue Oct 23 14:40:00 2007 @@ -275,7 +275,7 @@ { Pool *pool = source->pool; Id id, idp, idl, idns; - char buf[1024], oc, *p, *dep; + char buf[1024], *p, *dep; int i; if (provides) @@ -286,11 +286,11 @@ if (ISRELDEP(id)) continue; dep = (char *)id2str(pool, id); - if (!strncmp(dep, "locale(", 7) && strlen(dep) < sizeof(buf)) + if (!strncmp(dep, "locale(", 7) && strlen(dep) < sizeof(buf) - 2) { idp = 0; - strcpy(buf, dep); - dep = buf + 7; + strcpy(buf + 2, dep); + dep = buf + 2 + 7; if ((p = strchr(dep, ':')) != 0 && p != dep) { *p++ = 0; @@ -305,12 +305,9 @@ dep = p + 1; continue; } - strncpy(dep - 7, "Locale(", 7); - *p++ = ')'; - oc = *p; - *p = 0; - idl = str2id(pool, dep - 7, 1); - *p = oc; + strncpy(dep - 9, "language:", 9); + *p++ = 0; + idl = str2id(pool, dep - 9, 1); if (id) id = rel2id(pool, id, idl, REL_OR, 1); else @@ -319,8 +316,11 @@ } if (dep[0] && dep[1]) { - strncpy(dep - 7, "Locale(", 7); - idl = str2id(pool, dep - 7, 1); + for (p = dep; *p && *p != ')'; p++) + ; + *p = 0; + strncpy(dep - 9, "language:", 9); + idl = str2id(pool, dep - 9, 1); if (id) id = rel2id(pool, id, idl, REL_OR, 1); else @@ -353,6 +353,8 @@ if (ISRELDEP(id)) continue; dep = (char *)id2str(pool, id); + if (!strncmp(dep, "system:modalias(", 16)) + dep += 7; if (!strncmp(dep, "modalias(", 9) && dep[9] && dep[10] && strlen(dep) < sizeof(buf)) { strcpy(buf, dep); -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org