diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2009-06-16 09:57:34 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2009-06-16 09:57:34 +0000 |
commit | d8b1b851c713937bdb1a756f9419e3f97516d479 (patch) | |
tree | d5af5fa62fc2bad3772facf22637921ec07437d4 /src/fetch.c | |
parent | 0dfc53b0c3fe5c99c53873430bb0093e930a46f1 (diff) | |
download | apk-tools-d8b1b851c713937bdb1a756f9419e3f97516d479.tar.gz apk-tools-d8b1b851c713937bdb1a756f9419e3f97516d479.tar.bz2 apk-tools-d8b1b851c713937bdb1a756f9419e3f97516d479.tar.xz apk-tools-d8b1b851c713937bdb1a756f9419e3f97516d479.zip |
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.
Diffstat (limited to 'src/fetch.c')
-rw-r--r-- | src/fetch.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/fetch.c b/src/fetch.c index ad3a67c..826dc73 100644 --- a/src/fetch.c +++ b/src/fetch.c @@ -61,14 +61,13 @@ static int fetch_package(struct fetch_ctx *fctx, int i, r, fd; if (!(fctx->flags & FETCH_STDOUT)) { - struct apk_file_info fi; + struct stat st; snprintf(outfile, sizeof(outfile), "%s/%s-%s.apk", fctx->outdir ? fctx->outdir : ".", pkg->name->name, pkg->version); - if (apk_file_get_info(outfile, &fi) == 0 && - fi.size == pkg->size) + if (lstat(outfile, &st) == 0 && st.st_size == pkg->size) return 0; } apk_message("Downloading %s-%s", pkg->name->name, pkg->version); |