diff --git a/bin/is b/bin/is index f233cedca9ca918ac69256d0e58c3d01611e5aa1..3f0826955eb8411ffbb04d2fb8eb256ecbc02ef2 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 6995f093a0426c9ea48d3527d1c4b1fdf0f2dee1..32335f02a1c0b2de4f468bca48cb3559b9d23369 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)