fetch: use lstat to verify filesize on existing targets
since we dont verify the checksum we dont need to calculate it Speed up when you try fetch lots of stuff thats already there.cute-signatures
parent
0dfc53b0c3
commit
d8b1b851c7
|
@ -61,14 +61,13 @@ static int fetch_package(struct fetch_ctx *fctx,
|
||||||
int i, r, fd;
|
int i, r, fd;
|
||||||
|
|
||||||
if (!(fctx->flags & FETCH_STDOUT)) {
|
if (!(fctx->flags & FETCH_STDOUT)) {
|
||||||
struct apk_file_info fi;
|
struct stat st;
|
||||||
|
|
||||||
snprintf(outfile, sizeof(outfile), "%s/%s-%s.apk",
|
snprintf(outfile, sizeof(outfile), "%s/%s-%s.apk",
|
||||||
fctx->outdir ? fctx->outdir : ".",
|
fctx->outdir ? fctx->outdir : ".",
|
||||||
pkg->name->name, pkg->version);
|
pkg->name->name, pkg->version);
|
||||||
|
|
||||||
if (apk_file_get_info(outfile, &fi) == 0 &&
|
if (lstat(outfile, &st) == 0 && st.st_size == pkg->size)
|
||||||
fi.size == pkg->size)
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
apk_message("Downloading %s-%s", pkg->name->name, pkg->version);
|
apk_message("Downloading %s-%s", pkg->name->name, pkg->version);
|
||||||
|
|
Loading…
Reference in New Issue