index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Xavier Chantry <shiningxc@gmail.com> | 2009-08-07 16:58:01 +0200 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2009-08-08 11:13:33 -0500 |
commit | d7675e393ff3cecb5408c243898ebaae80c5988d (patch) | |
tree | 0b01068922dc66e74ac5628fcb5693f5194687a5 /lib/libalpm | |
parent | aba58e95abbeef2a9145ec702338def1e4912898 (diff) |
-rw-r--r-- | lib/libalpm/dload.c | 18 |
diff --git a/lib/libalpm/dload.c b/lib/libalpm/dload.c index 57c21b8e..4d1f9867 100644 --- a/lib/libalpm/dload.c +++ b/lib/libalpm/dload.c @@ -124,6 +124,10 @@ static int download_internal(const char *url, const char *localpath, destfile = get_destfile(localpath, filename); tempfile = get_tempfile(localpath, filename); + if(mtimeold) { + fileurl->last_modified = mtimeold; + } + /* pass the raw filename for passing to the callback function */ _alpm_log(PM_LOG_DEBUG, "using '%s' for download progress\n", filename); @@ -157,7 +161,13 @@ static int download_internal(const char *url, const char *localpath, sigaction(SIGPIPE, NULL, &old_action); sigaction(SIGPIPE, &new_action, NULL); - dlf = fetchXGet(fileurl, &ust, (handle->nopassiveftp ? "" : "p")); + dlf = fetchXGet(fileurl, &ust, (handle->nopassiveftp ? "i" : "pi")); + + if(fetchLastErrCode == FETCH_UNCHANGED) { + _alpm_log(PM_LOG_DEBUG, "mtimes are identical, skipping %s\n", filename); + ret = 1; + goto cleanup; + } if(fetchLastErrCode != 0 || dlf == NULL) { const char *host = _("disk"); @@ -173,12 +183,6 @@ static int download_internal(const char *url, const char *localpath, _alpm_log(PM_LOG_DEBUG, "connected to %s successfully\n", fileurl->host); } - if(ust.mtime && mtimeold && ust.mtime == mtimeold) { - _alpm_log(PM_LOG_DEBUG, "mtimes are identical, skipping %s\n", filename); - ret = 1; - goto cleanup; - } - if(ust.mtime && mtimenew) { *mtimenew = ust.mtime; } |