Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Composer with local SVN repo

I'm trying to run composer using a local SVN repo, I can hit the repo I want but composer keeps adding the /branch to the end of the URL.

How can I override this?

Here are the docs:

  • http://getcomposer.org/doc/05-repositories.md#vcs

Example of what I have

"repositories": [
    {
        "type": "vcs",
        "url": "http://host.com/externals/project",
        "trunk-path": "trunk",
        "branches-path": "branches",
        "tags-path": "tags",
        "reference": "symfony/symfony"
    }
],
"require": {
    "project/project": "svn-project"
}

Output is something like this:

[RuntimeException]                                                                                                                                                      
Repository http://host.com/externals/project/version could not be processed, 
svn: URL 'http://host.com/externals/project/version/branches' 
non-existent in that revision 

Here is my subversion layout:

http://host.com/externals/project/version
  • Externals are libraries like Symfony
  • Project is Symfony
  • version is 2.1.2

So my svn repo is like:

http://host.com/externals/symfony/2.1.2

any thoughts?

this is how the company I work for stores external libraries we are using

UPDATE:

I've changed our repo to this:

http://host.com/externals/symfony/trunk/ <-- empty directory
http://host.com/externals/symfony/branches/ <-- empty directory
http://host.com/externals/symfony/trunk/2.1.2 <-- holds the Symfony 2.1.2 release code

Now I get this message:

Reading composer.json of http://host.com/externals/symfony/ (2.1.2)
Importing tag 2.1.2 (2.1.2.0)

but it then still pulls from the github repo instead of my svn repo.

I've also read on Satis

  • http://getcomposer.org/doc/articles/handling-private-packages-with-satis.md

but if I do there where do I host this?

  • Which the project?
  • On my SVN Repo?
  • Elsewhere?
like image 983
Phill Pafford Avatar asked Oct 07 '22 05:10

Phill Pafford


1 Answers

Looks like Composer assumes you stick to the common repository layout of /trunk, /branches, and /tags. Plus you must enter the URL to the repository root--not the full project path. You specify the project-specific path with package-path.

See the doc Composer | Subversion Options.

Since Subversion has no native concept of branches and tags, Composer assumes by default that code is located in $url/trunk, $url/branches and $url/tags. If your repository has a different layout you can change those values.

like image 98
bahrep Avatar answered Oct 10 '22 04:10

bahrep