This is the mail archive of the
cygwin-apps
mailing list for the Cygwin project.
Re: [PATCH setup v2] Query the user if a corrupt local file is found
- From: Ken Brown <kbrown at cornell dot edu>
- To: cygwin-apps at cygwin dot com
- Date: Tue, 9 Jan 2018 21:52:01 -0500
- Subject: Re: [PATCH setup v2] Query the user if a corrupt local file is found
- Authentication-results: sourceware.org; auth=none
- References: <20180109222520.6880-1-kbrown@cornell.edu>
On 1/9/2018 5:25 PM, Ken Brown wrote:
Also reorganize package validation.
Move the size-validation code in download.cc and the hash-validation
code in install.cc into new member functions of the packagesource
class. Add a bool member 'validated' to the class to make sure that
the checking is done only once.
Change download.cc:check_for_cached() so that it offers to delete a
corrupt package file instead of throwing an exception. The latter
previously caused a fatal error when check_for_cached() was called
from do_download_thread and download_one. Now we get a fatal error
only if the user chooses not to delete the file.
Also make check_for_cached() check the hash of the file in addition to
the size. Similarly, check the hash in addition to the size after
downloading a file.
I missed 'pkgsource.set_cached ("")' in a couple places. v3 is on the way.
Ken