diff --git a/CHANGELOG.md b/CHANGELOG.md index 30b38d93..beca3302 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - #950: Added support for listing installed Python packages using `list -python`, `list -py` and `list-installed -python` - #822: The CPF resource processor now supports system expressions and macros in CPF merge files - #578 Added functionality to record and display IPM history of install, uninstall, load, and update +- #996:Ensure COS commands execute in exec under a dedicated, isolated context ### Changed - #316: All parameters, except developer mode, included with a `load`, `install` or `update` command will be propagated to dependencies diff --git a/src/cls/IPM/Main.cls b/src/cls/IPM/Main.cls index db2b1f69..0ee1f98e 100644 --- a/src/cls/IPM/Main.cls +++ b/src/cls/IPM/Main.cls @@ -980,8 +980,7 @@ ClassMethod ShellInternal( } elseif (tCommandInfo = "load") { do ..Load(.tCommandInfo) } elseif (tCommandInfo = "exec") { - write ! - xecute tCommandInfo("parameters","expression") + do ..ExecuteCOS(.tCommandInfo) } elseif (tCommandInfo = "install") { do ..Install(.tCommandInfo) } elseif (tCommandInfo = "reinstall") { @@ -2213,6 +2212,17 @@ ClassMethod Load( $$$ThrowOnError(log.Finalize($$$OK, devMode)) } +ClassMethod ExecuteCOS(ByRef tCommandInfo) +{ + set namespace = $namespace + try { + write ! + xecute tCommandInfo("parameters","expression") + } catch ex { + } + set $namespace = namespace +} + ClassMethod LoadInternal( ByRef pCommandInfo, pLog As %IPM.General.AbstractHistory) [ Internal ]