Commit 4575bdb3 authored by Seblu's avatar Seblu
Browse files

temporary repo now have a unique identifier

THis is very useful to be able to list it !
parent 851fc98a
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -35,7 +35,8 @@ def load_repositories(args):
    # load repo configs
    if args.repo_path is not None:
        # from command line
        repoman.register(RepositoryConfig(None, path=args.repo_path))
        repoman.register(RepositoryConfig(istools.smd5sum(args.repo_path)[:8],
                                          path=args.repo_path))
    else:
        # from config
        for repoconf in RepoConfigFile(args.repo_config).repos:
+1 −1
Original line number Diff line number Diff line
@@ -476,7 +476,7 @@ class RepositoryManager(object):
            self.cache_path = None
            debug("No repository cache")
        else:
            if istools.pathtype(cache_path) != "file":
            if not istools.isfile(cache_path):
                raise NotImplementedError("Repository cache must be local")
            self.cache_path =  os.path.abspath(cache_path)
            # must_path is a list of directory which must exists
+8 −0
Original line number Diff line number Diff line
@@ -28,6 +28,14 @@ def md5sum(path=None, fileobj=None):
        m.update(buf)
    return m.hexdigest()

def smd5sum(buf):
    '''
    Compute md5 of a string
    '''
    m = hashlib.md5()
    m.update(buf)
    return m.hexdigest()

def copyfileobj(sfile, dfile):
    '''
    Copy data from sfile to dfile computing length and md5 on the fly