Mailinglist Archive: zypp-commit (545 mails)

< Previous Next >
[zypp-commit] r8507 - in /trunk/sat-solver/src: repo.c repodata.c repodata.h
  • From: matz@xxxxxxxxxxxxxxxx
  • Date: Wed, 06 Feb 2008 19:37:45 -0000
  • Message-id: <20080206193746.1C5EA24848@xxxxxxxxxxxxxxxx>
Author: matz
Date: Wed Feb 6 20:37:45 2008
New Revision: 8507

URL: http://svn.opensuse.org/viewcvs/zypp?rev=8507&view=rev
Log:
Make repo_lookup_num work.

Modified:
trunk/sat-solver/src/repo.c
trunk/sat-solver/src/repodata.c
trunk/sat-solver/src/repodata.h

Modified: trunk/sat-solver/src/repo.c
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/src/repo.c?rev=8507&r1=8506&r2=8507&view=diff
==============================================================================
--- trunk/sat-solver/src/repo.c (original)
+++ trunk/sat-solver/src/repo.c Wed Feb 6 20:37:45 2008
@@ -781,8 +781,15 @@
continue;
for (j = 1; j < data->nkeys; j++)
{
- if (data->keys[j].name == key && (data->keys[j].type == TYPE_U32 ||
data->keys[j].type == TYPE_NUM))
- return repodata_lookup_num(data, n - data->start, j);
+ if (data->keys[j].name == key
+ && (data->keys[j].type == TYPE_U32
+ || data->keys[j].type == TYPE_NUM
+ || data->keys[j].type == TYPE_CONSTANT))
+ {
+ unsigned value;
+ if (repodata_lookup_num(data, n - data->start, j, &value))
+ return value;
+ }
}
}
return 0;

Modified: trunk/sat-solver/src/repodata.c
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/src/repodata.c?rev=8507&r1=8506&r2=8507&view=diff
==============================================================================
--- trunk/sat-solver/src/repodata.c (original)
+++ trunk/sat-solver/src/repodata.c Wed Feb 6 20:37:45 2008
@@ -423,7 +423,7 @@
return (const char *)dp;
if (key->type != TYPE_ID)
return 0;
- /* id type, must either use global or local string strore*/
+ /* id type, must either use global or local string store*/
dp = data_read_id(dp, &id);
if (data->localpool)
return data->spool.stringspace + data->spool.strings[id];
@@ -431,7 +431,7 @@
}

int
-repodata_lookup_num(Repodata *data, Id entry, Id keyid)
+repodata_lookup_num(Repodata *data, Id entry, Id keyid, unsigned *value)
{
Id schema;
Repokey *key;
@@ -439,6 +439,7 @@
KeyValue kv;
unsigned char *dp;

+ *value = 0;
dp = data->incoredata + data->incoreoffset[entry];
dp = data_read_id(dp, &schema);
/* make sure the schema of this solvable contains the key */
@@ -450,11 +451,14 @@
dp = get_data(data, key, &dp);
if (!dp)
return 0;
- if (key->type == TYPE_NUM || key->type == TYPE_U32)
- {
- dp = data_fetch(dp, &kv, key);
- return kv.num;
- }
+ if (key->type == TYPE_NUM
+ || key->type == TYPE_U32
+ || key->type == TYPE_CONSTANT)
+ {
+ dp = data_fetch(dp, &kv, key);
+ *value = kv.num;
+ return 1;
+ }
return 0;
}


Modified: trunk/sat-solver/src/repodata.h
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/src/repodata.h?rev=8507&r1=8506&r2=8507&view=diff
==============================================================================
--- trunk/sat-solver/src/repodata.h (original)
+++ trunk/sat-solver/src/repodata.h Wed Feb 6 20:37:45 2008
@@ -101,7 +101,7 @@

void repodata_search(Repodata *data, Id entry, Id keyname, int
(*callback)(void *cbdata, Solvable *s, Repodata *data, struct _Repokey *key,
struct _KeyValue *kv), void *cbdata);
const char *repodata_lookup_str(Repodata *data, Id entry, Id keyid);
-int repodata_lookup_num(Repodata *data, Id entry, Id keyid);
+int repodata_lookup_num(Repodata *data, Id entry, Id keyid, unsigned *value);

void repodata_extend(Repodata *data, Id p);


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

< Previous Next >
This Thread
  • No further messages