Author: mlschroe Date: Tue Mar 4 19:12:08 2008 New Revision: 9011 URL: http://svn.opensuse.org/viewcvs/zypp?rev=9011&view=rev Log: - fix susetags2solv -b bugs - do not hardcode dir 1 Modified: trunk/sat-solver/tools/repo_rpmmd.c trunk/sat-solver/tools/repo_susetags.c trunk/sat-solver/tools/susetags2solv.c Modified: trunk/sat-solver/tools/repo_rpmmd.c URL: http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/tools/repo_rpmmd.c?rev=9011&r1=9010&r2=9011&view=diff ============================================================================== --- trunk/sat-solver/tools/repo_rpmmd.c (original) +++ trunk/sat-solver/tools/repo_rpmmd.c Tue Mar 4 19:12:08 2008 @@ -708,13 +708,16 @@ id = str2id(pool, pd->content, 1); s->provides = repo_addid_dep(repo, s->provides, id, SOLVABLE_FILEMARKER); #endif - if ((p = strrchr(pd->content, '/')) != 0) { - *p++ = 0; - id = repodata_str2dir(pd->data, pd->content, 1); - } else { - id = 1; - p = pd->content; - } + if ((p = strrchr(pd->content, '/')) != 0) + { + *p++ = 0; + id = repodata_str2dir(pd->data, pd->content, 1); + } + else + { + p = pd->content; + id = repodata_str2dir(pd->data, "/", 1); + } repodata_add_dirstr(pd->data, entry, SOLVABLE_FILELIST, id, p); break; // xml store capabilities Modified: trunk/sat-solver/tools/repo_susetags.c URL: http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/tools/repo_susetags.c?rev=9011&r1=9010&r2=9011&view=diff ============================================================================== --- trunk/sat-solver/tools/repo_susetags.c (original) +++ trunk/sat-solver/tools/repo_susetags.c Tue Mar 4 19:12:08 2008 @@ -851,7 +851,7 @@ } } if (n != repo->end) - repodata_merge_attrs (data, i, last_found); + repodata_merge_attrs(data, i, last_found); } free (pd.share_with); } Modified: trunk/sat-solver/tools/susetags2solv.c URL: http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/tools/susetags2solv.c?rev=9011&r1=9010&r2=9011&view=diff ============================================================================== --- trunk/sat-solver/tools/susetags2solv.c (original) +++ trunk/sat-solver/tools/susetags2solv.c Tue Mar 4 19:12:08 2008 @@ -150,6 +150,26 @@ perror(descrdir); exit(1); } + + /* bring packages to front */ + for (i = 0; i < ndirs; i++) + { + char *fn = files[i]->d_name; + if (!strcmp(fn, "packages") || !strcmp(fn, "packages.gz")) + break; + } + if (i == ndirs) + { + fprintf(stderr, "found no packages file\n"); + exit(1); + } + if (i) + { + struct dirent *de = files[i]; + memmove(files + 1, files, i * sizeof(de)); + files[0] = de; + } + fnp = sat_malloc(strlen(descrdir) + 128); for (i = 0; i < ndirs; i++) { @@ -184,11 +204,11 @@ char lang[6]; char *p; sprintf(fnp, "%s/%s", descrdir, fn); - p = strrchr(fn, '.'); + p = strrchr(fnp, '.'); if (p && !strcmp(p, ".gz")) { *p = 0; - p = strrchr(fn, '.'); + p = strrchr(fnp, '.'); } if (!p || !p[1] || strlen(p + 1) > 5) continue; @@ -204,6 +224,8 @@ fclose(fp); } } + for (i = 0; i < ndirs; i++) + free(files[i]); free(files); free(fnp); } -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org