diff options
author | Michael Matz <matz@suse.de> | 2008-03-19 22:28:06 +0000 |
---|---|---|
committer | Michael Matz <matz@suse.de> | 2008-03-19 22:28:06 +0000 |
commit | eb7916da1418f09af7504f34dc1e379eb8e6b2ee (patch) | |
tree | 1d189dc0f49d9b8c0756ddaaa62646e1cb2ae45f /src/repopack.h | |
parent | bd37323a54c95e5fbb7eb5b2f6ad270b50b3a513 (diff) | |
download | libsolv-eb7916da1418f09af7504f34dc1e379eb8e6b2ee.tar.gz libsolv-eb7916da1418f09af7504f34dc1e379eb8e6b2ee.tar.bz2 libsolv-eb7916da1418f09af7504f34dc1e379eb8e6b2ee.zip |
Support new types for MD5 and SHA1 checksums (stored in binary, but with
support functions to deal with them being strings). Generate them from the
susetags parser for the =Cks tags.
Diffstat (limited to 'src/repopack.h')
-rw-r--r-- | src/repopack.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/repopack.h b/src/repopack.h index fa4e69d..4ce8991 100644 --- a/src/repopack.h +++ b/src/repopack.h @@ -84,6 +84,12 @@ data_fetch(unsigned char *dp, KeyValue *kv, Repokey *key) return data_read_id(dp, &kv->num); case REPOKEY_TYPE_U32: return data_read_u32(dp, (unsigned int *)&kv->num); + case REPOKEY_TYPE_MD5: + kv->str = (const char *)dp; + return dp + SIZEOF_MD5; + case REPOKEY_TYPE_SHA1: + kv->str = (const char *)dp; + return dp + SIZEOF_SHA1; case REPOKEY_TYPE_IDARRAY: return data_read_ideof(dp, &kv->id, &kv->eof); case REPOKEY_TYPE_DIRSTRARRAY: @@ -117,6 +123,10 @@ data_skip(unsigned char *dp, int type) return dp + 1; case REPOKEY_TYPE_U32: return dp + 4; + case REPOKEY_TYPE_MD5: + return dp + SIZEOF_MD5; + case REPOKEY_TYPE_SHA1: + return dp + SIZEOF_SHA1; case REPOKEY_TYPE_IDARRAY: case REPOKEY_TYPE_REL_IDARRAY: while ((*dp & 0xc0) != 0) @@ -176,6 +186,10 @@ data_skip_verify(unsigned char *dp, int type, int maxid, int maxdir) return dp + 1; case REPOKEY_TYPE_U32: return dp + 4; + case REPOKEY_TYPE_MD5: + return dp + SIZEOF_MD5; + case REPOKEY_TYPE_SHA1: + return dp + SIZEOF_SHA1; case REPOKEY_TYPE_ID: dp = data_read_id(dp, &id); if (id >= maxid) |