From 28c37ecb3ac159048ae5a935fa9bb1ff6fe684af Mon Sep 17 00:00:00 2001 From: Sebastien Luttringer <sebastien.luttringer@smartjog.com> Date: Fri, 21 Oct 2011 14:44:17 +0200 Subject: [PATCH] fix temporary caching of command line repostories --- bin/is | 2 +- installsystems/repository.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bin/is b/bin/is index f233ced..3f08269 100755 --- a/bin/is +++ b/bin/is @@ -37,7 +37,7 @@ def load_repositories(args): # load repo configs from command line if args.repo_path is not None: repoman.register(RepositoryConfig(istools.smd5sum(args.repo_path)[:8], - path=args.repo_path)) + path=args.repo_path), temp=True) # load repo configs from config for repoconf in RepoConfigFile(args.repo_config).repos: repoman.register(repoconf) diff --git a/installsystems/repository.py b/installsystems/repository.py index 6995f09..32335f0 100644 --- a/installsystems/repository.py +++ b/installsystems/repository.py @@ -512,7 +512,7 @@ class RepositoryManager(object): return True return False - def register(self, config): + def register(self, config, temp=False): ''' Register a repository from its config ''' @@ -531,16 +531,16 @@ class RepositoryManager(object): # path is remote, we need to create a cache else: debug("Registering cached repository %s (%s)" % (config.path, config.name)) - self.repos.append(self._cachify(config)) + self.repos.append(self._cachify(config, temp)) - def _cachify(self, config): + def _cachify(self, config, temp=False): ''' Return a config of a cached repository from an orignal config file ''' try: # Ensure destination file exists - if config.name is None or self.cache_path is None: + if temp is True or self.cache_path is None: # this is a forced temporary repository or without name repo tempfd, filedest = tempfile.mkstemp() os.close(tempfd) -- GitLab