예제 #1
0
def fill_filedetail():    
    for r in Repository.select():
        d = r.directory
        try:
            d = Directory.byName("%s/repodata" % (d.name))
        except:
            print "warning: Repository at Directory %s missing repodata subdir" % d.name
            continue
        for fd in d.fileDetails:
            if fd.filename == 'repomd.xml':
                try:
                    fname = "/%s/repomd.xml" % (d.name)
                    f = open(fname, 'rb')
                    s = f.read()
                    f.close()
                    h  = hashlib.sha256(s).hexdigest()
                    print "sha256=%s" % h
                    fd.sha256 =h
                    fd.sha512 = hashlib.sha512(s).hexdigest()
                    fd.sync()
                    del s
                except:
                    print "warning: couldn't update sha checksums for %s" % fname
                # only add to the most recent one
                break
예제 #2
0
 def setup_directory_repo_cache():
     cache = {}
     for r in list(Repository.select()):
         if r.directory and r.version and r.arch:
             cache[r.directory.id] = r
     return cache
예제 #3
0
def disabled_repository_cache():
    cache = {}
    for r in list(Repository.select()):
        if r.disabled:
            cache[r.prefix] = True
    return cache
 def setup_directory_repo_cache():
     cache = {}
     for r in list(Repository.select()):
         if r.directory:
             cache[r.directory.id] = r
     return cache