Skip to content

Commit

Permalink
Use --quiet-mode unattended for external Cygwin
Browse files Browse the repository at this point in the history
Given that the user may be prompted, ensure that the dialogs can be
used!
  • Loading branch information
dra27 committed Jun 25, 2024
1 parent 1674281 commit 6d904ca
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions master_changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ users)

## 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

Expand Down
5 changes: 3 additions & 2 deletions src/state/opamSysInteract.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1026,9 +1026,10 @@ 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";
Expand All @@ -1037,7 +1038,7 @@ let install_packages_commands_t ?(env=OpamVariable.Map.empty) config sys_package
"--no-write-registry";
"--packages";
String.concat "," packages;
] @ (if Cygwin.is_internal config then
] @ (if is_internal then
let common =
[ "--upgrade-also";
"--only-site";
Expand Down

0 comments on commit 6d904ca

Please sign in to comment.