Author: kkaempf Date: Wed Aug 13 10:25:36 2008 New Revision: 10830 URL: http://svn.opensuse.org/viewcvs/zypp?rev=10830&view=rev Log: if -r (root dir) is given, its also honored by -p (product dir) Modified: trunk/sat-solver/tools/rpmdb2solv.c Modified: trunk/sat-solver/tools/rpmdb2solv.c URL: http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/tools/rpmdb2solv.c?rev=10830&r1=10829&r2=10830&view=diff ============================================================================== --- trunk/sat-solver/tools/rpmdb2solv.c (original) +++ trunk/sat-solver/tools/rpmdb2solv.c Wed Aug 13 10:25:36 2008 @@ -103,9 +103,31 @@ if (!nopacks) repo_add_rpmdb(repo, repodata, ref, root); - if (proddir) - repo_add_products(repo, repodata, proddir); - + if (proddir && *proddir) + { + /* if <root> given, not '/', and proddir does not start with <root> */ + if (root && *root) + { + int rootlen = strlen(root); + if (strncmp(root, proddir, rootlen)) + { + char *buf; + buf = (char *)sat_malloc(rootlen + strlen(proddir) + 2); /* + '/' + \0 */ + strcpy(buf, root); + if (root[rootlen-1] != '/' + && *proddir != '/') + { + strcpy(buf+rootlen, "/"); + ++rootlen; + } + strcpy(buf+rootlen, proddir); + proddir = buf; + } + } + + repo_add_products(repo, repodata, proddir); + } + if (repodata) repodata_internalize(repodata); -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org