Skip to content

Commit

Permalink
Merge pull request #5830 from dra27/symlinks-internal
Browse files Browse the repository at this point in the history
Tweaks to internal Cygwin setup
  • Loading branch information
kit-ty-kate committed May 13, 2024
2 parents 036e26f + 2068837 commit 87cc8af
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 8 deletions.
3 changes: 3 additions & 0 deletions master_changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]
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

0 comments on commit 87cc8af

Please sign in to comment.