FS#22630 - Default curl command does not return error code on 404 response
Attached to Project:
Pacman
Opened by Xyne (Xyne) - Thursday, 27 January 2011, 16:22 GMT
Last edited by Dan McGee (toofishes) - Friday, 28 January 2011, 18:26 GMT
Opened by Xyne (Xyne) - Thursday, 27 January 2011, 16:22 GMT
Last edited by Dan McGee (toofishes) - Friday, 28 January 2011, 18:26 GMT
|
Details
Summary and Info:
Normally pacman will attempt to download from the next server in the mirrorlist when a download fails, e.g. :: Synchronizing package databases... error: failed retrieving file 'core.db.tar.gz' from 127.0.0.1 : Not Found core 36.6K 230.9K/s 00:00:00 [######################] 100% error: failed retrieving file 'extra.db.tar.gz' from 127.0.0.1 : Not Found extra 462.2K 788.1K/s 00:00:01 [######################] 100% xyne-any 6.7K 35.0K/s 00:00:00 [######################] 100% error: failed retrieving file 'community.db.tar.gz' from 127.0.0.1 : Not Found community 419.6K 772.0K/s 00:00:01 [######################] 100% error: failed retrieving file 'multilib.db.tar.gz' from 127.0.0.1 : Not Found multilib 22.7K 210.1K/s 00:00:00 [######################] 100% When using the XferCommand (e.g. "/usr/bin/curl -C - %u > %o"), pacman does not detect that the download has failed and does not continue to the next server, e.g. :: Synchronizing package databases... % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 6828 100 6828 0 0 8641 0 --:--:-- --:--:-- --:--:-- 17781 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 If the exit status cannot be used then perhaps pacman could directly check that the file has been downloaded. |
This task depends upon
Closed by Dan McGee (toofishes)
Friday, 28 January 2011, 18:26 GMT
Reason for closing: Fixed
Additional comments about closing: f95080884ca
Friday, 28 January 2011, 18:26 GMT
Reason for closing: Fixed
Additional comments about closing: f95080884ca
https://bbs.archlinux.org/viewtopic.php?pid=884196#p884196
After further investigation, I found that curl exits with 0 because it does not consider 404 File Not Found to be an error (which it technically isn't, as curl has worked as expected).
To make it exit with an error, you can use the "-f" option. I suggest that you update the default pacman.conf's curl XferCommand to:
#XferCommand = /usr/bin/curl -f -C - %u > %
I've tested it and it works as expected.