diff --git a/master_changes.md b/master_changes.md index 37e76a4f8c4..fdf89d15b43 100644 --- a/master_changes.md +++ b/master_changes.md @@ -67,6 +67,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] diff --git a/src/state/opamSysInteract.ml b/src/state/opamSysInteract.ml index 535bd2f73b7..9d48d0f62d3 100644 --- a/src/state/opamSysInteract.ml +++ b/src/state/opamSysInteract.ml @@ -317,7 +317,8 @@ module Cygwin = struct "--no-shortcuts"; "--no-startmenu"; "--no-write-registry"; - "--quiet-mode"; + "--no-version-check"; + "--quiet-mode"; "noinput"; ] @ match packages with | [] -> [] @@ -325,6 +326,12 @@ module Cygwin = struct [ "--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 -> @@ -966,7 +973,7 @@ 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"; @@ -974,12 +981,20 @@ let install_packages_commands_t ?(env=OpamVariable.Map.empty) config sys_package "--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 ->