Skip to content

Commit e607d7f

Browse files
committed
Fix param propagation
1 parent 68e2a15 commit e607d7f

File tree

2 files changed

+38
-37
lines changed

2 files changed

+38
-37
lines changed

preload/cls/IPM/Installer.cls

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -416,35 +416,4 @@ ClassMethod CreateTempDir() As %String
416416
return ##class(%File).NormalizeDirectory(tDir)
417417
}
418418

419-
/// This method is called directly in LoadNewModule() instead of with an <Invoke> in the module.xml
420-
/// because the old mappings break load/install before any <Invokes> can be run.
421-
ClassMethod CleanupOldMappings() As %Status
422-
{
423-
set sc = $$$OK
424-
// Cleanup old mappings from oddStudioDocument
425-
set key = ""
426-
for {
427-
set key = $order(^oddStudioDocument(key))
428-
quit:key=""
429-
if (key["%ZPM.PackageManager") || (key["%ZHSLIB.PackageManager") {
430-
kill ^oddStudioDocument(key)
431-
}
432-
}
433-
434-
set status = ##class(%IPM.Utils.Module).RemoveGlobalMapping($namespace,"oddStudioDocument:(BEGIN):(""%ZP"")","IRISLIB")
435-
if $$$ISERR(status) {
436-
set sc = $$$ADDSC(sc, status)
437-
}
438-
set status = ##class(%IPM.Utils.Module).RemoveGlobalMapping($namespace,"oddStudioDocument:(""%ZP""):(""A"")","IRISSYS")
439-
if $$$ISERR(status) {
440-
set sc = $$$ADDSC(sc, status)
441-
}
442-
set status = ##class(%IPM.Utils.Module).RemoveGlobalMapping($namespace,"oddStudioDocument:(""Ens""):(""Ent"")","ENSLIB")
443-
if $$$ISERR(status) {
444-
set sc = $$$ADDSC(sc, status)
445-
}
446-
447-
return sc
448-
}
449-
450419
}

src/cls/IPM/Utils/Module.cls

Lines changed: 38 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -274,17 +274,18 @@ ClassMethod LoadModuleFromDirectory(
274274
set tVerbose = $get(pParams("Verbose"))
275275
// LoadNewModule goes all the way through Reload->Validate->Compile->Activate, also compiling the new module.
276276
write:tVerbose !,"Loading from ",pDirectory,!
277+
278+
// Propagate all params to dependencies except those that should only apply to the top level module
277279
merge tParams = pParams
278280
if $get(pParams("Install")) || $get(pParams("Update")) {
279281
if $get(pParams("Update"),0) {
280282
set tParams("cmd") = "update"
281283
} else {
282284
zkill tParams("Install")
283285
}
284-
} else {
285-
// Propagate all params except developer mode to dependencies
286-
set tParams("DeveloperMode") = $get(pOverrideDeveloperMode,0)
287286
}
287+
set tParams("DeveloperMode") = $get(pOverrideDeveloperMode,0)
288+
288289
set tSC = ..LoadNewModule(pDirectory,.tParams,pRepository,pLog)
289290
if $$$ISERR(tSC) {
290291
quit
@@ -1097,7 +1098,7 @@ ClassMethod LoadNewModule(
10971098

10981099
// If installing new version of IPM, clean up old mappings
10991100
if newModuleObj.Name=$$$IPMModuleName {
1100-
$$$ThrowOnError(##class(IPM.Installer).CleanupOldMappings())
1101+
$$$ThrowOnError(..CleanupOldMappings())
11011102
}
11021103
}
11031104
if moduleCurrent '= "" {
@@ -1237,11 +1238,11 @@ ClassMethod LoadDependencies(
12371238
set permitDowngrade = +$get(pParams("PermitDowngrade"))
12381239
set ignoreInstalled = +$get(pParams("IgnoreInstalled"))
12391240
write !, "Building dependency graph..." // Intentionally always write even in non-verbose mode
1240-
set sc = pModule.BuildDependencyGraph(.depdendencyGraph,,reloadSnapshots,,"",,,,ignoreInstalled,,permitDowngrade)
1241+
set sc = pModule.BuildDependencyGraph(.dependencyGraph,,reloadSnapshots,,"",,,,ignoreInstalled,,permitDowngrade)
12411242
$$$ThrowOnError(sc)
12421243
write "Done."
12431244

1244-
do ..ConstructInvertedDependencyGraph(.depdendencyGraph, .invertedDependencyGraph)
1245+
do ..ConstructInvertedDependencyGraph(.dependencyGraph, .invertedDependencyGraph)
12451246
if isVerbose {
12461247
write !, "Created inverted dependency graph from dependency graph"
12471248
}
@@ -2417,4 +2418,35 @@ ClassMethod GetDeployedProjectName(moduleName As %String) As %String [ CodeMode
24172418
moduleName_$$$DeployedProjectSuffix
24182419
}
24192420

2421+
/// This method is called directly in LoadNewModule() instead of with an <Invoke> in the module.xml
2422+
/// because the old mappings break load/install before any <Invokes> can be run.
2423+
ClassMethod CleanupOldMappings() As %Status
2424+
{
2425+
set sc = $$$OK
2426+
// Cleanup old mappings from oddStudioDocument
2427+
set key = ""
2428+
for {
2429+
set key = $order(^oddStudioDocument(key))
2430+
quit:key=""
2431+
if (key["%ZPM.PackageManager") || (key["%ZHSLIB.PackageManager") {
2432+
kill ^oddStudioDocument(key)
2433+
}
2434+
}
2435+
2436+
set status = ##class(%IPM.Utils.Module).RemoveGlobalMapping($namespace,"oddStudioDocument:(BEGIN):(""%ZP"")","IRISLIB")
2437+
if $$$ISERR(status) {
2438+
set sc = $$$ADDSC(sc, status)
2439+
}
2440+
set status = ##class(%IPM.Utils.Module).RemoveGlobalMapping($namespace,"oddStudioDocument:(""%ZP""):(""A"")","IRISSYS")
2441+
if $$$ISERR(status) {
2442+
set sc = $$$ADDSC(sc, status)
2443+
}
2444+
set status = ##class(%IPM.Utils.Module).RemoveGlobalMapping($namespace,"oddStudioDocument:(""Ens""):(""Ent"")","ENSLIB")
2445+
if $$$ISERR(status) {
2446+
set sc = $$$ADDSC(sc, status)
2447+
}
2448+
2449+
return sc
2450+
}
2451+
24202452
}

0 commit comments

Comments
 (0)