Author: kkaempf Date: Thu Sep 4 12:32:31 2008 New Revision: 10929 URL: http://svn.opensuse.org/viewcvs/zypp?rev=10929&view=rev Log: - tools/rpmdb2solv: Adapt to xml-based /etc/products.d - tools/rpmdb2solv: Add '-a <attribute>' to print distribution.target attribute of baseproduct. Modified: trunk/sat-solver/package/libsatsolver.changes trunk/sat-solver/tools/repo_products.c Modified: trunk/sat-solver/package/libsatsolver.changes URL: http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/package/libsatsolver.changes?rev=10929&r1=10928&r2=10929&view=diff ============================================================================== --- trunk/sat-solver/package/libsatsolver.changes (original) +++ trunk/sat-solver/package/libsatsolver.changes Thu Sep 4 12:32:31 2008 @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Thu Sep 4 12:30:06 CEST 2008 - kkaempf@suse.de + +- tools/rpmdb2solv: Adapt to xml-based /etc/products.d +- tools/rpmdb2solv: Add '-a <attribute>' to print + distribution.target attribute of baseproduct. + +------------------------------------------------------------------- Tue Sep 2 12:17:03 CEST 2008 - mls@suse.de - make solver includes use "" instead of <>, fixes bnc#415920 Modified: trunk/sat-solver/tools/repo_products.c URL: http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/tools/repo_products.c?rev=10929&r1=10928&r2=10929&view=diff ============================================================================== --- trunk/sat-solver/tools/repo_products.c (original) +++ trunk/sat-solver/tools/repo_products.c Thu Sep 4 12:32:31 2008 @@ -32,6 +32,7 @@ static ino_t baseproduct = 0; +static ino_t currentproduct = 0; //#define DUMPOUT 0 @@ -97,7 +98,7 @@ struct stateswitch *swtab[NUMSTATES]; enum state sbtab[NUMSTATES]; - const char *attribute; /* only print this attribute */ + const char *attribute; /* only print this attribute, if currentproduct == baseproduct */ const char *tmplang; const char *tmpvers; @@ -216,7 +217,9 @@ repo_set_str(pd->repo, pd->s - pool->solvables, PRODUCT_FLAVOR, str); if ((str = find_attr("target", atts, 0))) { - if (pd->attribute && !strcmp(pd->attribute, "distribution.target")) + if (currentproduct == baseproduct + && pd->attribute + && !strcmp(pd->attribute, "distribution.target")) printf("%s\n", str); else repo_set_str(pd->repo, pd->s - pool->solvables, SOLVABLE_DISTRIBUTION, str); @@ -342,7 +345,17 @@ char buf[BUFF_SIZE]; int i, l; struct stateswitch *sw; + struct stat st; + if (!fstat(fileno(fp), &st)) + currentproduct = st.st_ino; + else + { + currentproduct = baseproduct+1; /* make it != baseproduct if stat fails */ + st.st_ctime = 0; + perror("Can't stat()"); + } + for (i = 0, sw = stateswitches; sw->from != NUMSTATES; i++, sw++) { if (!pd->swtab[sw->from]) @@ -370,18 +383,11 @@ if (pd->s) { Solvable *s = pd->s; - struct stat st; - if (!fstat(fileno(fp), &st)) - { - repodata_set_num(pd->data, pd->handle, SOLVABLE_INSTALLTIME, st.st_ctime); - /* this is where <productsdir>/baseproduct points to */ - if (st.st_ino == baseproduct) - repodata_set_str(pd->data, pd->handle, PRODUCT_TYPE, "base"); - } - else - { - perror("Can't stat()"); - } + + repodata_set_num(pd->data, pd->handle, SOLVABLE_INSTALLTIME, st.st_ctime); + /* this is where <productsdir>/baseproduct points to */ + if (currentproduct == baseproduct) + repodata_set_str(pd->data, pd->handle, PRODUCT_TYPE, "base"); if (pd->tmprel) { @@ -433,7 +439,9 @@ { baseproduct = st.st_ino; } - + else + baseproduct = 0; + while ((entry = readdir(dir))) { int len; -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org