aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabian Groffen <grobian@gentoo.org>2020-05-16 20:24:45 +0200
committerFabian Groffen <grobian@gentoo.org>2020-05-16 20:24:45 +0200
commitdcab7ec282cfb8827a95c59c51322271d14d91c4 (patch)
tree1b03f82f9e87e4643fdf43f139855e7e25bd7f1e /qcheck.c
parentqfile: print symlink targets in verbose mode (diff)
downloadportage-utils-dcab7ec282cfb8827a95c59c51322271d14d91c4.tar.gz
portage-utils-dcab7ec282cfb8827a95c59c51322271d14d91c4.tar.bz2
portage-utils-dcab7ec282cfb8827a95c59c51322271d14d91c4.zip
libq/hash: unify hash methods into single approach
remove duplicate hashing strategies, use private copies of md5 and sha1 hashes when ssl is not available, else rely on ssl to provide hashing capabilities Signed-off-by: Fabian Groffen <grobian@gentoo.org>
Diffstat (limited to 'qcheck.c')
-rw-r--r--qcheck.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/qcheck.c b/qcheck.c
index 72a68a92..9d9a86c1 100644
--- a/qcheck.c
+++ b/qcheck.c
@@ -18,7 +18,7 @@
#include "atom.h"
#include "contents.h"
#include "copy_file.h"
-#include "md5_sha1_sum.h"
+#include "hash.h"
#include "prelink.h"
#include "tree.h"
#include "xarray.h"
@@ -233,8 +233,8 @@ qcheck_cb(tree_pkg_ctx *pkg_ctx, void *priv)
}
hash_cb_t hash_cb =
- state->undo_prelink ? hash_cb_prelink_undo : hash_cb_default;
- f_digest = (char *)hash_file_at_cb(
+ state->undo_prelink ? hash_cb_prelink_undo : NULL;
+ f_digest = hash_file_at_cb(
pkg_ctx->cat_ctx->ctx->portroot_fd,
entry->name + 1, hash_algo, hash_cb);
@@ -242,7 +242,6 @@ qcheck_cb(tree_pkg_ctx *pkg_ctx, void *priv)
* Can we get a digest of the file? */
if (!f_digest) {
++num_files_unknown;
- free(f_digest);
if (state->qc_update)
fprintf(fp_contents_update, "%s\n", buffer);
@@ -283,11 +282,8 @@ qcheck_cb(tree_pkg_ctx *pkg_ctx, void *priv)
fprintf(fp_contents_update, "%s\n", buffer);
}
- free(f_digest);
continue;
}
-
- free(f_digest);
}
/* Validate mtimes */