Logo Search packages:      
Sourcecode: jhbuild version File versions  Download package

def jhbuild::versioncontrol::tarball::TarballBranch::_check_tarball (   self  )  [private]

Check whether the tarball has been downloaded correctly.

Definition at line 125 of file tarball.py.

00125                             :
        """Check whether the tarball has been downloaded correctly."""
        localfile = self._local_tarball
        if not os.path.exists(localfile):
            raise BuildStateError('file not downloaded')
        if self.source_size is not None:
            local_size = os.stat(localfile).st_size
            if local_size != self.source_size:
                raise BuildStateError('downloaded file size is incorrect '
                                      '(expected %d, got %d)'
                                      % (self.source_size, local_size))
        if self.source_md5 is not None:
            import md5
            local_md5 = md5.new()
            fp = open(localfile, 'rb')
            data = fp.read(32768)
            while data:
                data = fp.read(32768)
            if local_md5.hexdigest() != self.source_md5:
                raise BuildStateError('file MD5 sum is incorrect '
                                      '(expected %s, got %s)'
                                      % (self.source_md5,

    def _download_and_unpack(self, buildscript):

Generated by  Doxygen 1.6.0   Back to index