[opam-devel] can a repository URL point to a sub-directory of a git repo

Thomas Gazagnaire thomas at gazagnaire.org
Thu Jan 23 17:36:40 GMT 2014


> Oh, I see. I was supposed to directly pin the package, but that isn't supported yet. Got it.

After re-reading your question again, a possible solution is to have this hierarchy:

./packages/<name>.<version>/{opam,descr,url}

inside your git repo and adding it as a remote repo should work.

Thomas


> 
> 
> On Thu, Jan 23, 2014 at 11:46 AM, Thomas Gazagnaire <thomas at gazagnaire.org> wrote:
>  
>> that should be asdf/opam/{opam,url,descr}
>> 
>> It still doesn't work:
>> 
>> $ opam repository add asdf-dev git at github.com:agarwal/asdf.git
>> asdf-dev   Fetching git at github.com:agarwal/asdf.git
>> Updating ~/.opam/repo/compiler-index ...
>> Updating ~/.opam/compilers/ ...
>> Updating ~/.opam/repo/package-index ...
>> Updating ~/.opam/packages/ ...
>> Updating the cache of metadata (~/.opam/state.cache) ...
>> 
>> $ opam info asdf
>> [ERROR] No packages found.
>> '/Users/ashish/usr/ocaml/4.01.0/bin/opam info asdf' failed.
> 
> Ha I see, the package does not exist yet. So no, this is not supported. See https://github.com/ocaml/opam/issues/941
> 
> Thomas
> 
>> 
>> 
>> Also, with this, how does opam know what version to assign the package?
>> 
>> 
>> 
>> On Wed, Jan 22, 2014 at 2:23 PM, Ashish Agarwal <agarwal1975 at gmail.com> wrote:
>> During development of a repository foo, I often like to create within that repo an opam-repo. I'll have something like this:
>> 
>> foo/opam-repo/packages/foo/foo.master
>> 
>> With a local copy of foo, I can now do:
>> 
>> opam repository add foo-dev foo/opam-repo
>> 
>> which is nice. It let's me keep the opam package description up-to-date during rapid development of foo. However, now I'm wondering if I can refer to this sub-directory with a git URL, something like the following:
>> 
>> opam repository add foo-dev git at github.com:agarwal/foo/opam-repo
>> 
>> The above URL isn't valid however. Is there a way to accomplish this?
>> 
>> The workaround is easy enough. I can define this package in a dedicated git repository, like the main opam-repository. However, it is nice to keep the dev version of an opam package within the related repo.
>> 
> 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ocaml.org/pipermail/opam-devel/attachments/20140123/8887a61d/attachment.html>


More information about the opam-devel mailing list