Esempio n. 1
0
    def verify( self , filename , _name , release , params ) :
        _item = {}
        for type in ( 'MD5Sum' , 'SHA1' , 'SHA256' ) :
            if release.has_key(type) :
                for item in release[type] :
                    if item['name'] == _name :
                        _item.update( item )
        if _item :
            if repolib.integrity_check( filename , _item , params['pkgvflags'] ) :
                return True
            return False

        else :
            repolib.logger.error( "Checksum for file '%s' not found, exiting." % _name ) 
            return False
Esempio n. 2
0
    def download_pkg ( self , pkg ) :

        destname = os.path.join( self.repo.repo_path() , pkg['Filename'] )

        # FIXME : Perform this check while appending to download_pkgs ???
        if os.path.isfile( destname ) :
            if repolib.integrity_check( destname , pkg , self.repo.params['pkgvflags'] ) :
                return
            os.unlink( destname )
        else :
            path , name = os.path.split( destname )
            if not os.path.exists( path ) :
                os.makedirs( path )

        if not self.repo.downloadRawFile ( pkg['Filename'] , destname ) :
            repolib.logger.warning( "Failure downloading file '%s'" % os.path.basename(pkg['Filename']) )
Esempio n. 3
0
    def verify(self, filename, _name, release, params):
        _item = {}
        for type in ('MD5Sum', 'SHA1', 'SHA256'):
            if release.has_key(type):
                for item in release[type]:
                    if item['name'] == _name:
                        _item.update(item)
        if _item:
            if repolib.integrity_check(filename, _item, params['pkgvflags']):
                return True
            return False

        else:
            repolib.logger.error("Checksum for file '%s' not found, exiting." %
                                 _name)
            return False
Esempio n. 4
0
 def verify( self , filename , item , params ) :
     # FIXME : no matching on filename vs. href within item is done
     if repolib.integrity_check( filename , item , params['pkgvflags'] ) :
         return True
     return False
Esempio n. 5
0
 def verify(self, filename, item, params):
     # FIXME : no matching on filename vs. href within item is done
     if repolib.integrity_check(filename, item, params['pkgvflags']):
         return True
     return False