Mailinglist Archive: zypp-commit (266 mails)

< Previous Next >
[zypp-commit] r11713 - in /trunk/sat-solver/tools: repo_products.c repo_products.h rpmdb2solv.c
  • From: mlschroe@xxxxxxxxxxxxxxxx
  • Date: Wed, 19 Nov 2008 10:47:18 -0000
  • Message-id: <20081119104719.000DE9E4F6@xxxxxxxxxxxxxxxx>
Author: mlschroe
Date: Wed Nov 19 11:47:18 2008
New Revision: 11713

URL: http://svn.opensuse.org/viewcvs/zypp?rev=11713&view=rev
Log:
- get rid of that horrible rpmdb2solv hack, it's not used any more

Modified:
trunk/sat-solver/tools/repo_products.c
trunk/sat-solver/tools/repo_products.h
trunk/sat-solver/tools/rpmdb2solv.c

Modified: trunk/sat-solver/tools/repo_products.c
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/tools/repo_products.c?rev=11713&r1=11712&r2=11713&view=diff
==============================================================================
--- trunk/sat-solver/tools/repo_products.c (original)
+++ trunk/sat-solver/tools/repo_products.c Wed Nov 19 11:47:18 2008
@@ -106,7 +106,6 @@

struct stateswitch *swtab[NUMSTATES];
enum state sbtab[NUMSTATES];
- const char *attribute; /* only print this attribute, if currentproduct ==
baseproduct */

const char *tmplang;

@@ -278,16 +277,6 @@
if (pd->currentproduct == pd->baseproduct)
repodata_set_str(pd->data, pd->handle, PRODUCT_TYPE, "base");

- // output distver if requested, only if the product is
- // a base product
- // this is yum $releasever variable
- if (pd->currentproduct == pd->baseproduct
- && pd->attribute
- && !strcmp(pd->attribute, "releasever"))
- {
- printf("%s\n", pd->tmpvers);
- }
-
if (pd->tmprel)
{
if (pd->tmpvers)
@@ -346,22 +335,10 @@
break;
case STATE_TARGET:
repodata_set_str(pd->data, pd->handle, PRODUCT_REGISTER_TARGET,
pd->content);
- if (pd->currentproduct == pd->baseproduct
- && pd->attribute
- && !strcmp(pd->attribute, "register.target"))
- {
- printf("%s\n", pd->content);
- }
- break;
+ break;
case STATE_REGRELEASE:
repodata_set_str(pd->data, pd->handle, PRODUCT_REGISTER_RELEASE,
pd->content);
- if (pd->currentproduct == pd->baseproduct
- && pd->attribute
- && !strcmp(pd->attribute, "register.release"))
- {
- printf("%s\n", pd->content);
- }
- break;
+ break;
case STATE_CPEID:
if (pd->content)
repodata_set_str(pd->data, pd->handle, SOLVABLE_CPE_ID, pd->content);
@@ -594,7 +571,7 @@
/* Oh joy! Three parsers for the price of one! */

void
-repo_add_products(Repo *repo, const char *proddir, const char *root, const
char *attribute, int flags)
+repo_add_products(Repo *repo, const char *proddir, const char *root, int flags)
{
const char *fullpath = proddir;
DIR *dir;
@@ -616,8 +593,6 @@
pd.content = sat_malloc(256);
pd.acontent = 256;

- pd.attribute = attribute;
-
for (i = 0, sw = stateswitches; sw->from != NUMSTATES; i++, sw++)
{
if (!pd.swtab[sw->from])

Modified: trunk/sat-solver/tools/repo_products.h
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/tools/repo_products.h?rev=11713&r1=11712&r2=11713&view=diff
==============================================================================
--- trunk/sat-solver/tools/repo_products.h (original)
+++ trunk/sat-solver/tools/repo_products.h Wed Nov 19 11:47:18 2008
@@ -5,4 +5,4 @@
* for further information
*/

-void repo_add_products(Repo *repo, const char *proddir, const char *root,
const char *attribute, int flags);
+void repo_add_products(Repo *repo, const char *proddir, const char *root, int
flags);

Modified: trunk/sat-solver/tools/rpmdb2solv.c
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/tools/rpmdb2solv.c?rev=11713&r1=11712&r2=11713&view=diff
==============================================================================
--- trunk/sat-solver/tools/rpmdb2solv.c (original)
+++ trunk/sat-solver/tools/rpmdb2solv.c Wed Nov 19 11:47:18 2008
@@ -34,7 +34,6 @@
{
fprintf(stderr, "\nUsage:\n"
"rpmdb2solv [-n] [-x] [-b <basefile>] [-p <productsdir>] [-r
<root>]\n"
- " -a <attr> : Only print this attribute, no .solv generation. E.g.
'-a distribution.target'\n"
" -n : No packages, do not read rpmdb, useful to only parse
products\n"
" -x : use extrapool\n"
" -b <basefile> : Write .solv to <basefile>.solv instead of stdout\n"
@@ -52,30 +51,26 @@
Pool *pool = pool_create();
Repo *repo, *ref = 0;
Repodata *data;
- FILE *fp;
Pool *refpool;
int c, percent = 0;
int extrapool = 0;
int nopacks = 0;
const char *root = 0;
const char *basefile = 0;
+ const char *refname = 0;
char *proddir = 0;
- const char *attribute = 0;
char *outfile = 0;

/*
* parse arguments
*/

- while ((c = getopt(argc, argv, "Pa:hnxb:r:p:o:")) >= 0)
+ while ((c = getopt(argc, argv, "Phnxb:r:p:o:")) >= 0)
switch (c)
{
case 'h':
usage(0);
break;
- case 'a':
- attribute = optarg;
- break;
case 'r':
root = optarg;
break;
@@ -108,24 +103,31 @@
}

/*
- * ???
+ * optional arg is old version of rpmdb solv file
+ * should make this a real option instead
*/

if (optind < argc)
+ refname = argv[optind];
+
+ if (refname)
{
- if (extrapool)
- refpool = pool_create();
- else
- refpool = pool;
- if ((fp = fopen(argv[optind], "r")) == NULL)
+ FILE *fp;
+ if ((fp = fopen(refname, "r")) == NULL)
{
- perror(argv[optind]);
- exit(1);
+ perror(refname);
}
- ref = repo_create(refpool, "ref");
- repo_add_solv(ref, fp);
- repo_disable_paging(ref);
- fclose(fp);
+ else
+ {
+ if (extrapool)
+ refpool = pool_create();
+ else
+ refpool = pool;
+ ref = repo_create(refpool, "ref");
+ repo_add_solv(ref, fp);
+ repo_disable_paging(ref);
+ fclose(fp);
+ }
}

/*
@@ -157,7 +159,7 @@
strcpy(buf + rootlen, proddir);
}
}
- repo_add_products(repo, proddir, root, attribute, REPO_REUSE_REPODATA |
REPO_NO_INTERNALIZE);
+ repo_add_products(repo, proddir, root, REPO_REUSE_REPODATA |
REPO_NO_INTERNALIZE);
if (buf != proddir)
sat_free(buf);
}
@@ -173,10 +175,7 @@
ref = 0;
}

- if (!attribute)
- tool_write(repo, basefile, 0);
-
+ tool_write(repo, basefile, 0);
pool_free(pool);
-
exit(0);
}

--
To unsubscribe, e-mail: zypp-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: zypp-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages