Skip to content

Commit 2ebb6d0

Browse files
committed
disabled automatic updates by default
1 parent 66ca9a5 commit 2ebb6d0

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

Common/LPM/LPM.wl

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ inspectPackages[dir_String, cbk_] := Module[{
3838
] &/@ packages;
3939
]
4040

41-
PacletRepositories[list_List, OptionsPattern[]] := Module[{projectDir, info, repos, cache, updated, removed, new, current, updatable, skipUpdates = OptionValue["Passive"], versionControl, maxVersionDiff = OptionValue["MaxVersionDiff"]},
41+
PacletRepositories[list_List, OptionsPattern[]] := Module[{projectDir, info, repos, cache, updated, removed, new, current, updatable, skipUpdates = OptionValue["Passive"], automaticUpdates = OptionValue["AutomaticUpdates"], versionControl, maxVersionDiff = OptionValue["MaxVersionDiff"]},
4242
(* making key-values pairs *)
4343
repos = (#-><|"key"->#|>)&/@list // Association;
4444

@@ -132,7 +132,12 @@ PacletRepositories[list_List, OptionsPattern[]] := Module[{projectDir, info, rep
132132
new = InstallPaclet[projectDir] /@ new;
133133

134134
(* what must be updated *)
135-
updatable = Select[current, CheckUpdates];
135+
If[automaticUpdates,
136+
updatable = Select[current, CheckUpdates];
137+
,
138+
Echo["LPM >> Automatic updates are suppressed by default since 2.7.6"];
139+
updatable = <||>;
140+
];
136141

137142
(* will be updated *)
138143
updated = ((#->repos[#])&/@ Keys[updatable]) // Association;
@@ -182,7 +187,7 @@ PacletRepositories[list_List, OptionsPattern[]] := Module[{projectDir, info, rep
182187
Map[pacletDirectoryLoad] @ Map[DirectoryName] @ FileNames["PacletInfo.wl", {#}, {2}]& @ FileNameJoin[{projectDir, "wl_packages"}];
183188
]
184189

185-
Options[PacletRepositories] = {"Directory"->None, "Passive"->False, "ForceUpdates" -> False, "MaxVersionDiff" -> None, "UpdateInterval" -> Quantity[14, "Days"], "ConflictResolutionFunction" -> Function[{conflicting, true},
190+
Options[PacletRepositories] = {"Directory"->None, "Passive"->False, "ForceUpdates" -> False, "AutomaticUpdates"->True, "MaxVersionDiff" -> None, "UpdateInterval" -> Quantity[14, "Days"], "ConflictResolutionFunction" -> Function[{conflicting, true},
186191
Echo["LPM >> resolving by uninstalling a global one"];
187192
If[PacletUninstall[conflicting] =!= Null,
188193
Echo["FAILED!"];

Scripts/start.wls

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ PacletRepositories[{
1919
Github -> "https://github.com/JerryI/CSocketListener" -> "master",
2020
Github -> "https://github.com/JerryI/wl-wlx" -> "master",
2121
Github -> "https://github.com/JerryI/wl-misc" -> "main"
22-
}, "Directory" -> Directory[], "MaxVersionDiff"-> 1 ]
22+
}, "Directory" -> Directory[], "MaxVersionDiff"-> 1, "AutomaticUpdates"-> False ]
2323

2424
(* web-server *)
2525
Needs["KirillBelov`CSockets`"]
@@ -215,7 +215,7 @@ WLJSPackages`Repositories[{
215215
WLJSPackages`Github -> "https://github.com/JerryI/wljs-demos-archive" -> "base",
216216
WLJSPackages`Github -> "https://github.com/JerryI/wljs-debugger" -> "base",
217217
WLJSPackages`Github -> "https://github.com/JerryI/wljs-api" -> "base"
218-
}, "Directory" -> Directory[], "MaxVersionDiff"-> 3 ]
218+
}, "Directory" -> Directory[], "MaxVersionDiff"-> 3, "AutomaticUpdates"-> False ]
219219

220220
RandomWord[];
221221

0 commit comments

Comments
 (0)