Properly build shared/static libxbps and utils.

xbps-fetch: added -v flag to see verbose messages in libfetch.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091030111726-axf9paz2k01ntqzz
This commit is contained in:
Juan RP
2009-10-30 12:17:26 +01:00
parent 79f9f34775
commit 3905c2106c
16 changed files with 145 additions and 66 deletions

View File

@ -53,10 +53,10 @@ xbps_get_file_hash(const char *file)
if ((fd = open(file, O_RDONLY)) == -1)
return NULL;
SHA256_Init(&ctx);
XBPS_SHA256_Init(&ctx);
while ((bytes = read(fd, buf, sizeof(buf))) > 0)
SHA256_Update(&ctx, buf, (size_t)bytes);
hash = strdup(SHA256_End(&ctx, digest));
XBPS_SHA256_Update(&ctx, buf, (size_t)bytes);
hash = strdup(XBPS_SHA256_End(&ctx, digest));
(void)close(fd);
return hash;