libalpm/dload: add allow_resume and reorder error checks
commit204bbc47149c948b680735a933fa395ce3983f38
authorDan McGee <dan@archlinux.org>
Thu, 21 Apr 2011 22:24:04 +0000 (21 17:24 -0500)
committerDan McGee <dan@archlinux.org>
Fri, 22 Apr 2011 22:08:33 +0000 (22 17:08 -0500)
tree24e7ebf943295c5ad2a881d4ef62e15741ea07bd
parent934e8c79afcb0df8b750322c5e87d77203d9f1fe
libalpm/dload: add allow_resume and reorder error checks

The allow_resume is the start of the fix to the "don't ever resume
database downloads" problem, as well as being useful for '.sig'
downloads as well. For now, we say "always allow resume", but this will
eventually get pushed down as necessary.

Error checks are reworked in order to correctly error out when a file is
not found on the remote end and reports 0 bytes downloaded. In addition,
the two error messages printed are now different as one reports a more
specific error message provided via the cURL error buffer.

Some example output from an -Sy run with [testing], [community],
[community2], [eee], and [nonexistant] defined as repos. [community2]
and [nonexistant] are both invalid, one using FTP and one using HTTP.

    :: Synchronizing package databases...
    testing is up to date
    community is up to date
    error: failed retrieving file 'community2.db' from ftp.archlinux.org : Given file does not exist
    error: failed to update community2 (FTP: couldn't retrieve (RETR failed) the specified file)
    eee is up to date
    error: failed retrieving file 'nonexistant.db' from code.toofishes.net : The requested URL returned error: 404
    error: failed to update nonexistant (HTTP response code said error)

Signed-off-by: Dan McGee <dan@archlinux.org>
lib/libalpm/dload.c