X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=lib%2Fzpm.c;h=f0ae5a2a3d2fcf4ab0045f8c4e03e9870875cb05;hb=d3b90e6aa8ab580c77ead76ff5c6c6dca7991cc6;hp=8e0687542c290f49dbdf0298045a0bb67a158cd1;hpb=c3a6daeacf5c6873cec41fa35ef5b917d335ad6a;p=zpackage diff --git a/lib/zpm.c b/lib/zpm.c index 8e06875..f0ae5a2 100644 --- a/lib/zpm.c +++ b/lib/zpm.c @@ -354,12 +354,12 @@ int zpm_close(struct zpm *pkg) { return 1; } -static int zpm_sqlite_vercmp(void *not_used, int unknown, const void *a, - int unk2, const void *b) { +static int zpm_sqlite_vercmp(void *not_used, int lena, const void *a, + int lenb, const void *b) { /* not sure what the ints are, possibly string lengths */ - not_used = 0; /* suppress warning */ - unknown = 0; /* suppress warning */ - unk2 = 0; + if (not_used != 0) fprintf(stderr, "sqlite vercmp not_used = %p\n", + not_used); + if (lena == 0 && lenb > 0) return 1; return zpm_vercmp(a, b); } @@ -425,7 +425,7 @@ int zpm_extract(struct zpm *pkg, char *hash, char *path, int mode) { /* didn't find a row */ sqlite3_finalize(ifile); sqlite3_close(db); - fprintf(stderr, "no such hash\n"); + fprintf(stderr, "no such hash: %s\n", hash); return 0; } /* either way we're done with this now */ @@ -483,7 +483,7 @@ int zpm_hash(char *path, char *hash, uint32_t flags) { int fd; void *content; struct stat sbuf; - hash_state md; + struct sha256_state md; int j; unsigned char tmp[32]; @@ -715,7 +715,7 @@ int zpm_import(struct zpm *pkg, char *path, uint32_t flags, char *hash) { void *content; struct stat sbuf; unsigned char tmp[32]; - hash_state md; + struct sha256_state md; sqlite3_stmt *ifile; int haverow = 0,havedata = 0; int j,rc,type; @@ -734,7 +734,9 @@ int zpm_import(struct zpm *pkg, char *path, uint32_t flags, char *hash) { hash = hashbuf; } - flags = 0; /* suppress warning, probably use to follow symlinks */ + if (flags) { + fprintf(stderr, "zpm_import unused flags = %d\n", flags); + } /* mmap the file */ fd = open(path, O_RDONLY); if (fd == -1) {