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

Tweaks to internal Cygwin setup #5830

Merged
merged 3 commits into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions master_changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ users)
## Opamfile

## External dependencies
* Pass --symlink-type native to Cygwin setup if symlinks are available [#5830 @dra27]
* Pass --no-version-check to Cygwin setup (suppresses a message box if setup needs updating) [#5830 @dra27]
* Pass --quiet-mode noinput to stop the user interrupting the setup GUI [#5830 @dra27]

## Format upgrade
* Handle init OCaml `sys-ocaml-*` eval variables during format upgrade from 2.0 -> 2.1 -> 2.2 [#5829 @dra27]
Expand Down
31 changes: 23 additions & 8 deletions src/state/opamSysInteract.ml
Original file line number Diff line number Diff line change
Expand Up @@ -317,14 +317,21 @@ module Cygwin = struct
"--no-shortcuts";
"--no-startmenu";
"--no-write-registry";
"--quiet-mode";
"--no-version-check";
"--quiet-mode"; "noinput";
] @
match packages with
| [] -> []
| spkgs ->
[ "--packages";
OpamStd.List.concat_map "," OpamSysPkg.to_string spkgs ]
in
let args =
if Unix.has_symlink () then
"--symlink-type" :: "native" :: args
else
args
in
OpamSystem.make_command
(OpamFilename.to_string local_cygwin_setupexe)
args @@> fun r ->
Expand Down Expand Up @@ -966,20 +973,28 @@ let install_packages_commands_t ?(env=OpamVariable.Map.empty) config sys_package
stored in `sys-pkg-manager-cmd` field *)
[`AsUser (OpamFilename.to_string (Cygwin.cygsetup ())),
[ "--root"; (OpamFilename.Dir.to_string (Cygwin.cygroot config));
"--quiet-mode";
"--quiet-mode"; "noinput";
"--no-shortcuts";
"--no-startmenu";
"--no-desktop";
"--no-admin";
"--packages";
String.concat "," packages;
] @ (if Cygwin.is_internal config then
[ "--upgrade-also";
"--only-site";
"--site"; Cygwin.mirror;
"--local-package-dir";
OpamFilename.Dir.to_string (Cygwin.internal_cygcache ());
] else [])
let common =
[ "--upgrade-also";
"--only-site";
"--no-version-check";
"--site"; Cygwin.mirror;
"--local-package-dir";
OpamFilename.Dir.to_string (Cygwin.internal_cygcache ());
]
in
if Unix.has_symlink () then
"--symlink-type" :: "native" :: common
else
common
else [])
],
None
| Debian ->
Expand Down
Loading