FS#4633 - Use hash to check package database version on mirror sites
Attached to Project:
Pacman
Opened by Anonymous Submitter - Sunday, 14 May 2006, 00:00 GMT
Last edited by arjan timmerman (blaasvis) - Thursday, 25 May 2006, 15:53 GMT
Opened by Anonymous Submitter - Sunday, 14 May 2006, 00:00 GMT
Last edited by arjan timmerman (blaasvis) - Thursday, 25 May 2006, 15:53 GMT
|
Details
Hi,
Everytime I run "pacman -Sy" to update my package database files pacman always downloads the full database files. Although downloading around a megabyte each time is probably not a big load on the mirror sites, it would seem to me that it would be more efficient (and polite to the mirror sites) to have pacman download a file containing an md5sum or a sha1sum (or similar hash), compare it with the locally calculated or stored hash, and only then download the package database file if there is a difference. The goal of this feature request is similar to Because of the importance of the package database, if the database is downloaded after there is a hash mismatch, I think there would be value in then comparing the a locally calculate database hash with the has file downloaded. If there is a mismatch at that point, it would mean that the mirror site is inconsistent, and therefore a different mirror should be used. Anyway, just a thought. Regards, Mark. |
This task depends upon
Thanks for answering, I didn't realise pacman did that. Everytime I've run it seemed to be downloading the files.
Do you happen to know if what you've said about it checking still applies if an external download utility is used for the download ? Fairly recently I've set the XferCommand option in my pacman.conf file to use wget, to enable download speed limiting via the --limit-rate option (note that I thought it was always downloading the db.tar.gz files even before I made this change, so I don't think it co-incided). Being able to set the download speed limit is quite useful on a slower link, so that you can still do other things like browse the web while the package downloads are occuring (of course I could use the Linux kernel's network traffic shaping capabilities to do this, however it is a lot more work than specifing a limit on wget to achieve the same or similar result.)
I do agree 400KB isn't a lot to download, it just seems to me that a few KB download of a hashfile and then a hash comparison would be achieve the same result with a lot more network/mirror site efficiency, as well as providing a further level of assurance of the integrity of the repository files. (Actually, thinking about it from a security point of view, it would be better to download the hash from the main archlinux.org site, and then compare it with the mirror site. This would further protect against either a mirror site being out of date or having been intentionally subverted.)
Thanks,
Mark.
If you use a XferCommand or use a HTTP mirror then I'd guess you are right, pacman always refreshes the db files.
The security aspect is a nice one, never thought of that.
We don't support this method when using HTTP in pacman2, but we should have it in pacman3.