diff options
author | Timo Teras <timo.teras@iki.fi> | 2009-06-28 18:05:17 +0300 |
---|---|---|
committer | Timo Teras <timo.teras@iki.fi> | 2009-06-28 18:52:40 +0300 |
commit | fac4cdb3fad6037e0841724a50d5364d16603f07 (patch) | |
tree | 3d180deab279e6e0046ebba1cdc9a02e97d85516 /src/add.c | |
parent | 7a29678aac20ac9e113704f8a5743f6051edef8d (diff) | |
download | apk-tools-fac4cdb3fad6037e0841724a50d5364d16603f07.tar.gz apk-tools-fac4cdb3fad6037e0841724a50d5364d16603f07.tar.bz2 apk-tools-fac4cdb3fad6037e0841724a50d5364d16603f07.tar.xz apk-tools-fac4cdb3fad6037e0841724a50d5364d16603f07.zip |
blob: function to checksum a blob
And use it in couple of places. Some whitespace fixes too.
Diffstat (limited to 'src/add.c')
-rw-r--r-- | src/add.c | 10 |
1 files changed, 1 insertions, 9 deletions
@@ -41,14 +41,6 @@ static int add_parse(void *ctx, int optch, int optindex, const char *optarg) return 0; } -static void md5_str(const char *str, md5sum_t csum) -{ - struct md5_ctx ctx; - md5_init(&ctx); - md5_process(&ctx, str, strlen(str)); - md5_finish(&ctx, csum); -} - static int cup(void) { /* compressed/uncompressed size is 259/1213 */ @@ -111,7 +103,7 @@ static int add_main(void *ctx, int argc, char **argv) goto err; } virtpkg->name = apk_db_get_name(&db, APK_BLOB_STR(actx->virtpkg)); - md5_str(virtpkg->name->name, virtpkg->csum); + apk_blob_csum(APK_BLOB_STR(virtpkg->name->name), virtpkg->csum); virtpkg->version = strdup("0"); virtpkg->description = strdup("virtual meta package"); virtdep = apk_dep_from_pkg(&db, virtpkg); |