Skip to content

Commit f7a4ba4

Browse files
committed
Chain the disjunctions instead
Two-fold reason: 1. Fully automates the generation of the infrastructure (because ocaml-variants.5.2.0+ox now always refers just to oxcaml-patch-guards) 2. Avoids a DNF explosion in opam
1 parent 5eb0d78 commit f7a4ba4

File tree

105 files changed

+383
-223
lines changed
  • packages
    • oxcaml-alcotest-patches/oxcaml-alcotest-patches.enabled
    • oxcaml-alcotest/oxcaml-alcotest.guard
    • oxcaml-backoff-patches/oxcaml-backoff-patches.enabled
    • oxcaml-backoff/oxcaml-backoff.guard
    • oxcaml-ctypes-foreign-patches/oxcaml-ctypes-foreign-patches.enabled
    • oxcaml-ctypes-foreign/oxcaml-ctypes-foreign.guard
    • oxcaml-ctypes-patches/oxcaml-ctypes-patches.enabled
    • oxcaml-ctypes/oxcaml-ctypes.guard
    • oxcaml-dot-merlin-reader-patches/oxcaml-dot-merlin-reader-patches.enabled
    • oxcaml-dot-merlin-reader/oxcaml-dot-merlin-reader.guard
    • oxcaml-dune-patches/oxcaml-dune-patches.enabled
    • oxcaml-dune-rpc-patches/oxcaml-dune-rpc-patches.enabled
    • oxcaml-dune-rpc/oxcaml-dune-rpc.guard
    • oxcaml-dune/oxcaml-dune.guard
    • oxcaml-dyn-patches/oxcaml-dyn-patches.enabled
    • oxcaml-dyn/oxcaml-dyn.guard
    • oxcaml-eio-patches/oxcaml-eio-patches.enabled
    • oxcaml-eio_linux-patches/oxcaml-eio_linux-patches.enabled
    • oxcaml-eio_linux/oxcaml-eio_linux.guard
    • oxcaml-eio_main-patches/oxcaml-eio_main-patches.enabled
    • oxcaml-eio_main/oxcaml-eio_main.guard
    • oxcaml-eio_posix-patches/oxcaml-eio_posix-patches.enabled
    • oxcaml-eio_posix/oxcaml-eio_posix.guard
    • oxcaml-eio/oxcaml-eio.guard
    • oxcaml-gen_js_api-patches/oxcaml-gen_js_api-patches.enabled
    • oxcaml-gen_js_api/oxcaml-gen_js_api.guard
    • oxcaml-js_of_ocaml-compiler-patches/oxcaml-js_of_ocaml-compiler-patches.enabled
    • oxcaml-js_of_ocaml-compiler/oxcaml-js_of_ocaml-compiler.guard
    • oxcaml-js_of_ocaml-patches/oxcaml-js_of_ocaml-patches.enabled
    • oxcaml-js_of_ocaml-ppx-patches/oxcaml-js_of_ocaml-ppx-patches.enabled
    • oxcaml-js_of_ocaml-ppx/oxcaml-js_of_ocaml-ppx.guard
    • oxcaml-js_of_ocaml-toplevel-patches/oxcaml-js_of_ocaml-toplevel-patches.enabled
    • oxcaml-js_of_ocaml-toplevel/oxcaml-js_of_ocaml-toplevel.guard
    • oxcaml-js_of_ocaml/oxcaml-js_of_ocaml.guard
    • oxcaml-jsonrpc-patches/oxcaml-jsonrpc-patches.enabled
    • oxcaml-jsonrpc/oxcaml-jsonrpc.guard
    • oxcaml-lsp-patches/oxcaml-lsp-patches.enabled
    • oxcaml-lsp/oxcaml-lsp.guard
    • oxcaml-lwt-patches/oxcaml-lwt-patches.enabled
    • oxcaml-lwt_ppx-patches/oxcaml-lwt_ppx-patches.enabled
    • oxcaml-lwt_ppx/oxcaml-lwt_ppx.guard
    • oxcaml-lwt/oxcaml-lwt.guard
    • oxcaml-mdx-patches/oxcaml-mdx-patches.enabled
    • oxcaml-mdx/oxcaml-mdx.guard
    • oxcaml-merlin-lib-patches/oxcaml-merlin-lib-patches.enabled
    • oxcaml-merlin-lib/oxcaml-merlin-lib.guard
    • oxcaml-merlin-patches/oxcaml-merlin-patches.enabled
    • oxcaml-merlin/oxcaml-merlin.guard
    • oxcaml-notty-community-patches/oxcaml-notty-community-patches.enabled
    • oxcaml-notty-community/oxcaml-notty-community.guard
    • oxcaml-obuild-patches/oxcaml-obuild-patches.enabled
    • oxcaml-obuild/oxcaml-obuild.guard
    • oxcaml-ocaml-compiler-libs-patches/oxcaml-ocaml-compiler-libs-patches.enabled
    • oxcaml-ocaml-compiler-libs/oxcaml-ocaml-compiler-libs.guard
    • oxcaml-ocaml-index-patches/oxcaml-ocaml-index-patches.enabled
    • oxcaml-ocaml-index/oxcaml-ocaml-index.guard
    • oxcaml-ocaml-lsp-server-patches/oxcaml-ocaml-lsp-server-patches.enabled
    • oxcaml-ocaml-lsp-server/oxcaml-ocaml-lsp-server.guard
    • oxcaml-ocamlbuild-patches/oxcaml-ocamlbuild-patches.enabled
    • oxcaml-ocamlbuild/oxcaml-ocamlbuild.guard
    • oxcaml-ocamlc-loc-patches/oxcaml-ocamlc-loc-patches.enabled
    • oxcaml-ocamlc-loc/oxcaml-ocamlc-loc.guard
    • oxcaml-ocamlformat-lib-patches/oxcaml-ocamlformat-lib-patches.enabled
    • oxcaml-ocamlformat-lib/oxcaml-ocamlformat-lib.guard
    • oxcaml-ocamlformat-patches/oxcaml-ocamlformat-patches.enabled
    • oxcaml-ocamlformat/oxcaml-ocamlformat.guard
    • oxcaml-odoc-driver-patches/oxcaml-odoc-driver-patches.enabled
    • oxcaml-odoc-driver/oxcaml-odoc-driver.guard
    • oxcaml-odoc-md-patches/oxcaml-odoc-md-patches.enabled
    • oxcaml-odoc-md/oxcaml-odoc-md.guard
    • oxcaml-odoc-parser-patches/oxcaml-odoc-parser-patches.enabled
    • oxcaml-odoc-parser/oxcaml-odoc-parser.guard
    • oxcaml-odoc-patches/oxcaml-odoc-patches.enabled
    • oxcaml-odoc/oxcaml-odoc.guard
    • oxcaml-ojs-patches/oxcaml-ojs-patches.enabled
    • oxcaml-ojs/oxcaml-ojs.guard
    • oxcaml-ordering-patches/oxcaml-ordering-patches.enabled
    • oxcaml-ordering/oxcaml-ordering.guard
    • oxcaml-patch-guards/oxcaml-patch-guards.ox
    • oxcaml-ppx_deriving-patches/oxcaml-ppx_deriving-patches.enabled
    • oxcaml-ppx_deriving/oxcaml-ppx_deriving.guard
    • oxcaml-ppxlib-patches/oxcaml-ppxlib-patches.enabled
    • oxcaml-ppxlib_ast-patches/oxcaml-ppxlib_ast-patches.enabled
    • oxcaml-ppxlib_ast/oxcaml-ppxlib_ast.guard
    • oxcaml-ppxlib/oxcaml-ppxlib.guard
    • oxcaml-re-patches/oxcaml-re-patches.enabled
    • oxcaml-re/oxcaml-re.guard
    • oxcaml-sedlex-patches/oxcaml-sedlex-patches.enabled
    • oxcaml-sedlex/oxcaml-sedlex.guard
    • oxcaml-sherlodoc-patches/oxcaml-sherlodoc-patches.enabled
    • oxcaml-sherlodoc/oxcaml-sherlodoc.guard
    • oxcaml-spawn-patches/oxcaml-spawn-patches.enabled
    • oxcaml-spawn/oxcaml-spawn.guard
    • oxcaml-stdune-patches/oxcaml-stdune-patches.enabled
    • oxcaml-stdune/oxcaml-stdune.guard
    • oxcaml-topkg-patches/oxcaml-topkg-patches.enabled
    • oxcaml-topkg/oxcaml-topkg.guard
    • oxcaml-utop-patches/oxcaml-utop-patches.enabled
    • oxcaml-utop/oxcaml-utop.guard
    • oxcaml-uutf-patches/oxcaml-uutf-patches.enabled
    • oxcaml-uutf/oxcaml-uutf.guard
    • oxcaml-wasm_of_ocaml-compiler-patches/oxcaml-wasm_of_ocaml-compiler-patches.enabled
    • oxcaml-wasm_of_ocaml-compiler/oxcaml-wasm_of_ocaml-compiler.guard
    • oxcaml-zarith-patches/oxcaml-zarith-patches.enabled

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+383
-223
lines changed

layout.sh

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ elif [[ ! -d ocaml-variants/ocaml-variants.5.2.0+ox ]]; then
99
fi
1010

1111
rm -rf oxcaml-*
12+
last_guard=''
1213
for entry in *; do
1314
if [[ -d $entry ]]; then
1415
[[ $entry != 'ocaml-variants' ]] || continue
@@ -20,7 +21,7 @@ for entry in *; do
2021
# Ignore JS 0.18 preview packages
2122
;;
2223
*)
23-
if [[ ! -e oxcaml-patch-guards/oxcaml-patch-guards.ox/opam ]]; then
24+
if [[ -z $last_guard ]]; then
2425
mkdir -p oxcaml-patch-guards/oxcaml-patch-guards.ox
2526
cat > oxcaml-patch-guards/oxcaml-patch-guards.ox/opam <<EOF
2627
opam-version: "2.0"
@@ -34,7 +35,7 @@ authors: "David Allsopp"
3435
license: "CC0-1.0+"
3536
homepage: "https://oxcaml.org"
3637
bug-reports: "https://github.com/oxcaml/opam-repository/issues"
37-
depends: [
38+
depends: "oxcaml-$entry" {post} | "oxcaml-$entry-patches" {post}
3839
EOF
3940
fi
4041
if [[ ! -e oxcaml-$entry/oxcaml-$entry.guard/opam ]]; then
@@ -50,9 +51,11 @@ homepage: "https://oxcaml.org"
5051
bug-reports: "https://github.com/oxcaml/opam-repository/issues"
5152
conflicts: [ "oxcaml-$entry-patches" "$entry" ]
5253
EOF
53-
cat >> oxcaml-patch-guards/oxcaml-patch-guards.ox/opam << EOF
54-
("oxcaml-$entry" {post} | "oxcaml-$entry-patches" {post})
54+
if [[ -n $last_guard ]]; then
55+
cat >> "oxcaml-$last_guard/oxcaml-$last_guard.guard/opam" <<EOF
56+
depends: "oxcaml-$entry" {post} | "oxcaml-$entry-patches" {post}
5557
EOF
58+
fi
5659
mkdir -p "oxcaml-$entry-patches/oxcaml-$entry-patches.enabled"
5760
cat > "oxcaml-$entry-patches/oxcaml-$entry-patches.enabled/opam" <<EOF
5861
opam-version: "2.0"
@@ -64,12 +67,17 @@ license: "CC0-1.0+"
6467
homepage: "https://oxcaml.org"
6568
bug-reports: "https://github.com/oxcaml/opam-repository/issues"
6669
conflicts: "oxcaml-$entry"
67-
depends: "$entry" {build & (
68-
${entry//?/ } = "${package#"$entry".}"
70+
depends: [
71+
"$entry" {build & (
72+
${entry//?/ } = "${package#"$entry".}"
6973
EOF
74+
if [[ -n $last_guard ]]; then
75+
sed -i -e '/depends:/a\ ("oxcaml-'"$entry"'" {post} | "oxcaml-'"$entry"'-patches" {post})' "oxcaml-$last_guard-patches/oxcaml-$last_guard-patches.enabled/opam"
76+
fi
77+
last_guard="$entry"
7078
else
7179
cat >> "oxcaml-$entry-patches/oxcaml-$entry-patches.enabled/opam" <<EOF
72-
${entry//?/ } | = "${package#"$entry".}"
80+
${entry//?/ } | = "${package#"$entry".}"
7381
EOF
7482
fi;;
7583
esac
@@ -84,10 +92,9 @@ for entry in oxcaml-*; do
8492
package="${entry#oxcaml-}"
8593
package="${package%-patches}"
8694
cat >> "$entry/"*"/opam" <<EOF
87-
${package//?/ } )}
95+
${package//?/ } )}
96+
]
8897
EOF
8998
;;
9099
esac
91100
done
92-
93-
echo ']' >> oxcaml-patch-guards/oxcaml-patch-guards.ox/opam

packages/oxcaml-alcotest-patches/oxcaml-alcotest-patches.enabled/opam

Lines changed: 6 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/oxcaml-alcotest/oxcaml-alcotest.guard/opam

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/oxcaml-backoff-patches/oxcaml-backoff-patches.enabled/opam

Lines changed: 6 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/oxcaml-backoff/oxcaml-backoff.guard/opam

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/oxcaml-ctypes-foreign-patches/oxcaml-ctypes-foreign-patches.enabled/opam

Lines changed: 6 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/oxcaml-ctypes-foreign/oxcaml-ctypes-foreign.guard/opam

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/oxcaml-ctypes-patches/oxcaml-ctypes-patches.enabled/opam

Lines changed: 6 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/oxcaml-ctypes/oxcaml-ctypes.guard/opam

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/oxcaml-dot-merlin-reader-patches/oxcaml-dot-merlin-reader-patches.enabled/opam

Lines changed: 6 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)