Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support <pkg>.opam files #53

Closed
wants to merge 3 commits into from
Closed

Support <pkg>.opam files #53

wants to merge 3 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Mar 22, 2017

This PR adds support for projects defining multiple opam packages in the same repository.

The behavior is only changed when there is no opam file but some <pkg>.opam files are present. This way opam-publish works the same as before for existing users.

In the case where there is no opam file but there are <pkg>.opam files, opam-publish prepare prepares a submission for each <pkg>.opam. Moreover, if an explicit package name is specified on the command line, it only prepares a submission for <pkg>.opam. It is an error if an explicit name is specified but there is no corresponding <pkg>.opam file.

I tested the patch to create this PR: ocaml/opam-repository#8776

Jeremie Dimino added 2 commits March 22, 2017 09:57
Use "<pkg>.opam" files when there are some but no "opam" file is
present. This is useful for repositories containing multiple opam
packages.
@AltGr
Copy link
Contributor

AltGr commented Mar 23, 2017

Oh, that's awesome, thanks! I'll also have use for this :)

Did you make sure to still support the case of directories (pkg1.opam/opam, pkg2.opam/opam...) instead of just files ?

@ghost
Copy link
Author

ghost commented Mar 23, 2017

Ah, I didn't know you could do this. I saw the thing about the opam subdirectory, and though you were supposed to look for the <pkg>.opam files in there... I just checked the manual and saw this was documented. I'll update the patch.

BTW for new projects, is there any point in using a directory rather than a file? I imagine that the directory is so that you can group the various files (opam, descr, ...) for a given package. However it seems that opam 2 allows you to put everything in the <pkg>.opam directly.

@AltGr
Copy link
Contributor

AltGr commented Mar 23, 2017

Indeed, but it could still have a use for the files/ overlays.

@ghost
Copy link
Author

ghost commented Apr 3, 2017

I added support for <pkg>.opam directories.

Note that the patch looks big, but it is actually much smaller if you read it with a good diff tool: https://github.com/janestreet/patdiff/blob/master/bin/patdiff-git-wrapper

@rgrinberg
Copy link

@AltGr what's the status on this? I will find this functionality to be very useful very soon.

@AltGr
Copy link
Contributor

AltGr commented May 12, 2017

I backported to the new 1.3 branch, since the master branch uses the new opam libs and should'nt be used on the current, 1.2 repo (1.2 and 1.3 have no changes in format).

@AltGr
Copy link
Contributor

AltGr commented May 12, 2017

(which explains the spurious warnings on ocaml/opam-repository#8776)

@AltGr
Copy link
Contributor

AltGr commented May 12, 2017

This seems to work well for opam-publish prepare, but what about opam-publish submit ?
I have an attempt to add it, need to clean it up and will add that too.

@dbuenzli
Copy link

@AltGr I think that a first step for useful for topkg opam submit would be to make the [dir] argument of submit repeatable. More ambitious would be #38 and #29. (And since you are there maybe you could have a look at #43).

@ghost
Copy link
Author

ghost commented May 15, 2017

So far i've done the submits one by one, but submitting multiple packages at once would be great indeed

@XVilka
Copy link

XVilka commented Dec 13, 2019

Have you decided what to do with this one?

@AltGr
Copy link
Contributor

AltGr commented Dec 13, 2019

This PR was for opam-publish 1.0, it's well obsolete; this is all well supported by opam-publish 2.0 :)

@AltGr AltGr closed this Dec 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants