-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support enabling IPM instance-wide #485
base: v1
Are you sure you want to change the base?
Conversation
Even %SYS, but not using the %ALL namespace because that ends up overriding namespace-specific mappings (gah).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@isc-tleavitt a few comments but looks good!
} | ||
Set pointer = 0 | ||
While $ListNext(namespaces,pointer,namespace) { | ||
Set $Namespace = namespace |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Defensive coding to string leading/trailing white space and control characters from namespace name before trying to switch to it
Set key = "" | ||
For { | ||
Set key = $Order(list(key)) | ||
Quit:key="" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Avoid using post conditionals
If globally { | ||
Set namespaces = "" | ||
Do ..GetListNamespace(.list) | ||
Kill list("%ALL") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Add a comment as to why removing %ALL so we don't forget the context.
Set pointer = 0 | ||
While $ListNext(namespaces,pointer,namespace) { | ||
Set $Namespace = namespace | ||
If $$$comClassDefined("%IPM.Storage.Module") && ##class(%IPM.Storage.Module).NameExists($$$IPMModuleName) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move existence check for IPM in a specific namespace to a utility helper method so we can keep the checks consistent (will also be helpful for some HS utilities to call probably)
@@ -1150,6 +1156,38 @@ ClassMethod Version(ByRef pCommandInfo) [ Internal ] | |||
Quit $$$OK | |||
} | |||
|
|||
ClassMethod AddIPMMappedNamespaces(ByRef list) [ Private ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Document expected format of list
Set namespace = "" | ||
For { | ||
Set namespace = $Order(allNS(namespace)) | ||
Quit:namespace="" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: use if instead
This is done via new options in the existing zpm "enable" command that add package mappings.
We looked into using %ALL but ultimately that doesn't work, because namespace-specific mappings aren't allowed to override %ALL mappings (!?).
Fixes #470