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

Add ? operator to filter syntax #2921

Merged
merged 3 commits into from
May 4, 2017
Merged

Add ? operator to filter syntax #2921

merged 3 commits into from
May 4, 2017

Conversation

dra27
Copy link
Member

@dra27 dra27 commented Apr 28, 2017

See also ocaml/opam-file-format#4 - this PR should have a commit updating src_ext before it is merged.

The ? operator evaluates to false if the expression is undefined (i.e. contains undefined variables) and true in all other instances.

This operator removes the need for evil uses of "%{variable}%" (which expands to an empty string if variable is undefined). In particular, for the ocaml-system package, it allows a slightly less unclear available field:

available:
  sys-ocaml-version = "4.02.2" &
  !(?switch-arch & switch-arch != sys-ocaml-arch) &
  !(?switch-cc & switch-cc != sys-ocaml-cc) &
  !(?switch-libc & switch-libc != sys-ocaml-libc)

@dra27 dra27 force-pushed the defined-operator branch 4 times, most recently from ebaf3a6 to 7e6c90a Compare April 29, 2017 07:37
@dra27
Copy link
Member Author

dra27 commented Apr 29, 2017

The two temporary commits are obviously just that, but note that 6b2a19f includes changes which should be made, since lib-ext is presently using an older release of opam-file-format

@AltGr
Copy link
Member

AltGr commented May 2, 2017

Thanks! We'll also need to update the doc (https://github.com/ocaml/opam/blob/master/doc/pages/Manual.md#filters and general syntax above)

The ? operator evaluates to false if the expression is undefined (i.e.
contains undefined variables) and true in all other instances.

This operator removes the need for evil uses of "%{variable}%" (which
expands to an empty string if variable is undefined).

Signed-off-by: David Allsopp <david.allsopp@metastack.com>
@dra27 dra27 force-pushed the defined-operator branch from 7e6c90a to caf0ba6 Compare May 3, 2017 14:37
@dra27 dra27 force-pushed the defined-operator branch from caf0ba6 to c3180a7 Compare May 3, 2017 14:38
@dra27
Copy link
Member Author

dra27 commented May 3, 2017

Docs updated, and also the temporary lib-ext pointer changed.

Is there anything else I need to do to this one?

@dra27 dra27 force-pushed the defined-operator branch from c3180a7 to 8f9336b Compare May 3, 2017 14:40
@AltGr
Copy link
Member

AltGr commented May 4, 2017

Nope, seems all OK to me. The temporary commits actually don't need to be temporary anymore (it's fine to require the master version of opam-file-format for CI !)
Just waiting for Travis to complete

@AltGr
Copy link
Member

AltGr commented May 4, 2017

Thanks!

@AltGr AltGr merged commit 0c40cfb into ocaml:master May 4, 2017
@dra27 dra27 deleted the defined-operator branch May 24, 2017 09:54
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.

2 participants