'Check the downloaded archive against a checksum digest.
No-op if this stage checks code out of a repository.'

@_needs_stage
def check(self):

    if (not self.digest):
        raise NoDigestError('Attempt    to    check    URLFetchStrategy    with    no    digest.')
    checker = crypto.Checker(self.digest)
    if (not checker.check(self.archive_file)):
        raise ChecksumError(('%s    checksum    failed    for    %s' % (checker.hash_name, self.archive_file)), ('Expected    %s    but    got    %s' % (self.digest, checker.sum)))
