diff --git a/master_changes.md b/master_changes.md index c9531e3f69c..96d54e6f7ee 100644 --- a/master_changes.md +++ b/master_changes.md @@ -62,6 +62,8 @@ users) ## Opamfile ## External dependencies + * Always pass --no-version-check and --no-write-registry to Cygwin setup [#6046 @dra27] + * Use --quiet-mode noinput for the internal Cygwin installation (which is definitely a fully-specified command line) and --quiet-mode unattended for external Cygwin installations (in case the user does need to select something, e.g. a mirror) [#6046 @dra27] ## Format upgrade diff --git a/src/state/opamSysInteract.ml b/src/state/opamSysInteract.ml index c14b8f1eb26..a3d6f3f9b45 100644 --- a/src/state/opamSysInteract.ml +++ b/src/state/opamSysInteract.ml @@ -1026,21 +1026,22 @@ let install_packages_commands_t ?(env=OpamVariable.Map.empty) config sys_package | Cygwin -> (* We use setup_x86_64 to install package instead of `cygcheck` that is stored in `sys-pkg-manager-cmd` field *) + let is_internal = Cygwin.is_internal config in [`AsUser (OpamFilename.to_string (Cygwin.cygsetup ())), [ "--root"; (OpamFilename.Dir.to_string (Cygwin.cygroot config)); - "--quiet-mode"; "noinput"; + "--quiet-mode"; (if is_internal then "noinput" else "unattended"); "--no-shortcuts"; "--no-startmenu"; "--no-desktop"; "--no-admin"; + "--no-version-check"; + "--no-write-registry"; "--packages"; String.concat "," packages; - ] @ (if Cygwin.is_internal config then + ] @ (if is_internal then let common = [ "--upgrade-also"; "--only-site"; - "--no-write-registry"; - "--no-version-check"; "--site"; Cygwin.mirror; "--local-package-dir"; OpamFilename.Dir.to_string (Cygwin.internal_cygcache ());