This is the mail archive of the cygwin-apps mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH setup v2] Query the user if a corrupt local file is found


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]