Add custom repositories
2060
def command_repo_add(self):
        
        if len(self.args) == 3 and self.args[0] == "repo-add":
            Repo().add(self.args[1], self.args[2])
        else:
            usage("")
933213
protected function addThemeRepositoryToRootComposer()
    {
        $composer = json_decode(file_get_contents(base_path('composer.json')), true);

        $composer['repositories'][] = [
            'type' => 'path',
            'url' => './'.$this->relativeThemePath(),
        ];

        file_put_contents(
            base_path('composer.json'),
            json_encode($composer, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES)
        );
    }
1080709
def load_repo_addons(_globals):
    '''
    '''
    repos_dir = os.path.expanduser('~/.fabsetup-addon-repos')
    if os.path.isdir(repos_dir):
        basedir, repos, _ = next(os.walk(repos_dir))
        for repo_dir in [os.path.join(basedir, repo)
                         for repo in repos
                         # omit dot dirs like '.rope'
                         # or 'fabsetup-theno-termdown.disabled'
                         if '.' not in repo]:
            sys.path.append(repo_dir)
            package_name, username = package_username(repo_dir.split('/')[-1])
            load_addon(username, package_name, _globals)
170478
def add_repos(repos)
      return if repos.empty?

      repos[@appliance_config.os.version].each do |name, repo|
        r = { 'name' => name, 'ephemeral' => true }

        ['baseurl', 'mirrorlist'].each { |type| r[type] = substitute_vars(repo[type]) unless repo[type].nil? }

        @appliance_config.repos << r
      end
    end
1101648
def enable_apt_repositories(prefix, url, version, repositories):
    
    with settings(hide('warnings', 'running', 'stdout'),
                  warn_only=False, capture=True):
        sudo('apt-add-repository "%s %s %s %s"' % (prefix,
                                                   url,
                                                   version,
                                                   repositories))
        with hide('running', 'stdout'):
            output = sudo("DEBIAN_FRONTEND=noninteractive /usr/bin/apt-get update")
        if 'Some index files failed to download' in output:
            raise SystemExit(1)
        else:
            # if we didn't abort above, we should return True
            return True
382121
private void addRepository(String repositoryId, RepositoryWrapper repositoryHolder) {
        repositories.put(repositoryId, repositoryHolder);
        try {
            numRepos = getNumberOfRepositories();
        } catch (WIMException e) {
            // okay
        }
    }
596488
def add_remote_repository( url, username = nil, password = nil )
      if username
        @resolver.addRemoteRepositoryByUrl( url, username, password )
      else
        @resolver.addRemoteRepositoryByUrl( url )
      end
    end
315392
public function addRepository(
        string $appName,
        string $indexName,
        TransformableRepository $repository
    ) {
        $this->repositories[$appName][$indexName] = $repository;
    }
300595
public Repository addRepository( String name,
                                     HttpServletRequest request ) {
        Repository repository = new Repository(name, request);
        repositories.add(repository);
        return repository;
    }
1029974
def require_repo(directory=None):
    """"""
    if directory and not os.path.isdir(directory):
        raise ValueError('Directory not found: ' + repr(directory))
    repo = repo_path(directory)
    if not os.path.isdir(repo):
        raise RepositoryNotFoundError(directory)
    return repo
395638
def should_use_custom_repo(args, cd_conf, repo_url):
    
    if repo_url:
        # repo_url signals a CLI override, return False immediately
        return False
    if cd_conf:
        if cd_conf.has_repos:
            has_valid_release = args.release in cd_conf.get_repos()
            has_default_repo = cd_conf.get_default_repo()
            if has_valid_release or has_default_repo:
                return True
    return False
1023636
public void addRepository(Repository repo) throws GreenPepperServerException
    {
        if (findRepositoryByName(repo.getName()) != null)
        {
            throw new GreenPepperServerException( GreenPepperServerErrorKey.REPOSITORY_ALREADY_EXISTS, "Repository already exists");
        }

        repo.setProject(this);
        repositories.add(repo);
    }
386589
@SuppressWarnings("unchecked")
    public static Set<Repository> toRepositoryList(Vector<Object> repositoriesParams)
    {
        Set<Repository> repositories = new TreeSet<Repository>();
        for(Object repositoryParams : repositoriesParams)
        {
            repositories.add(toRepository((Vector<Object>)repositoryParams));
        }
        
        return repositories;
    }
1326850
public void addRepository(RepositoryAdmin repositoryAdmin, String repository)
    {
        try {
            if (repository != null)
            {
                boolean duplicate = false;
                for (Repository repo : repositoryAdmin.listRepositories())
                {
                    if (repository.equalsIgnoreCase(repo.getURI()))
                        duplicate = true;
                }
                if (!duplicate)
                {
                    Repository repo = repositoryAdmin.addRepository(repository);
                    if (repo == null)
                        repositoryAdmin.removeRepository(repository);   // Ignore repos not found
                }
            }
        } catch (Exception e) {
            // Ignore exception e.printStackTrace();
        }
    }
216790
def _remote_add(self):
        """"""
        self.repo.create_remote(
            'origin',
            'git@github.com:{username}/{repo}.git'.format(
                username=self.metadata.username,
                repo=self.metadata.name))
277032
public static function add_to_repo($repository_path, $files = null)
    {
        $repo = new pakeMercurial($repository_path);
        $repo->add($files);

        return $repo;
    }
912989
def update(custom_sources=False):
    """"""
    if not shutil.which('git'):
        print('Git executable not found in $PATH.')
        sys.exit(1)

    if not custom_sources:
        print('Creating sources.yaml…')
        write_sources_file()
        print('Cloning sources…')
        sources_file = rel_to_cwd('sources.yaml')
        jobs = yaml_to_job_list(sources_file, rel_to_cwd('sources'))
        git_clone_job_list(jobs)

    print('Cloning templates…')
    jobs = yaml_to_job_list(rel_to_cwd('sources', 'templates', 'list.yaml'),
                            rel_to_cwd('templates'))
    print('Cloning schemes…')
    jobs.extend(yaml_to_job_list(rel_to_cwd('sources', 'schemes', 'list.yaml'),
                                 rel_to_cwd('schemes')))
    git_clone_job_list(jobs)
    print('Completed updating repositories.')