Merge lp:~jeff-apple/openvista-gtm-integration/bug355710 into lp:openvista-gtm-integration

Proposed by jeff.apple
Status: Merged
Merged at revision: not available
Proposed branch: lp:~jeff-apple/openvista-gtm-integration/bug355710
Merge into: lp:openvista-gtm-integration
Diff against target: None lines
To merge this branch: bzr merge lp:~jeff-apple/openvista-gtm-integration/bug355710
Reviewer Review Type Date Requested Status
Jon Tai Approve
Review via email: mp+5778@code.launchpad.net
To post a comment you must log in.
Revision history for this message
jeff.apple (jeff-apple) wrote :

Needs header comment update.

The structure of this thing is odd. It enters what is essentially the "body" of the FOR loop once in the DO before starting the FOR loop, then repeats the body again with the same variables on the first FOR loop iteration. Is this the desired behavior? If not, then the DO can be removed.

I would rename the variable OS to be more specific, such as ISGTM. Actually rather than that, why not remove OS completely and have ROUT determine the platform instead of passing it as a parameter? That way it could be expanded for other platforms besides GTM and Cache.

Revision history for this message
Jon Tai (jontai) wrote :

Let's rename OS => ISGTM, then commit.

review: Approve
22. By jeff.apple

Rename variable, add comment

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'mumps/XPDR.m'
2--- mumps/XPDR.m 1970-01-01 00:00:00 +0000
3+++ mumps/XPDR.m 2009-04-22 07:44:39 +0000
4@@ -0,0 +1,156 @@
5+XPDR ;SFISC/RSD - Routine File Edit ;09/17/96 10:05
6+ ;;8.0;KERNEL;**1,2,44,MSC**;Jul 10, 1995
7+ Q
8+UPDT ;update routine file
9+ N DIR,DIRUT,XPD,XPDI,XPDJ,XPDN,X,X1,Y,Y1,% W !
10+ W ! S DIR(0)="FO^1:9^K:X'?.1""-""1U.7UNP X",DIR("A")="Routine Namespace",DIR("?")="Enter 1 to 8 characters, preceed with ""-"" to exclude namespace"
11+ ;XPDN(0=excluded names or 1=include names, namespace)=""
12+ F D ^DIR Q:$D(DIRUT) S X=$E(Y,$L(Y))="*",%=$E(Y)="-",XPDN('%,$E(Y,%+1,$L(Y)-X))=""
13+ Q:'$D(XPDN)!$D(DTOUT)!$D(DUOUT)
14+ W !!,"NAMESPACE INCLUDE",?35,"EXCLUDE",!,?11,"-------",?35,"-------"
15+ S (X,Y)="",(X1,Y1)=1
16+ F D W !?11,X,?35,Y Q:'X1&'Y1
17+ .S:X1 X=$O(XPDN(1,X)),X1=X]"" S:Y1 Y=$O(XPDN(0,Y)),Y1=Y]""
18+ K DIR S DIR(0)="Y",DIR("A")="OK to continue",DIR("B")="YES" D ^DIR
19+ Q:'Y!$D(DIRUT) W !
20+ S DIR(0)="Y",DIR("A")="Want me to clean up the Routine File before updating",DIR("?")="YES means you want to go throught the Routine file and delete any routine name that no longer exists on the system."
21+ D ^DIR
22+ Q:$D(DIRUT) D WAIT^DICD,DELRTN:Y
23+ ;loop thru include list XPDN(1,XPDI)
24+ N OS S OS=$G(^%ZOSF("OS"))["GT.M"
25+ S XPDI="" F S XPDI=$O(XPDN(1,XPDI)) Q:XPDI="" D
26+ .D:OS SILENT^%RSEL("*") S XPDJ=XPDI D:$$ROUT(1,OS,XPDJ) F S XPDJ=$$ROUT(0,OS,XPDJ) Q:XPDJ=""!($P(XPDJ,XPDI)]"") D
27+ ..;if name XPDJ is in the exclude list, XPDN(0,XPDJ) or in Routine file, quit
28+ ..Q:$D(XPDN(0,XPDJ))!$O(^DIC(9.8,"B",XPDJ,0))
29+ ..;check if XPDJ is refered in the namespace by checking the subscript
30+ ..;before XPDJ, if sub exist and $P(XPDJ,sub)="" then it is part of the
31+ ..;namespace, quit
32+ ..S %=$O(XPDN(0,XPDJ),-1) I $L(%),$P(XPDJ,%)="" Q
33+ ..N XPD S XPD(9.8,"+1,",.01)=XPDJ,XPD(9.8,"+1,",1)="R"
34+ ..D ADD^DICA("","XPD")
35+ W " ...Done.",!
36+ Q
37+ROUT(D,OS,VALUE) ;
38+ I D,OS Q $D(%ZR(VALUE))
39+ I OS Q $O(%ZR(VALUE))
40+ N A I D X "S X=$D(^$R(VALUE))" Q A
41+ X "S A=$O(^$R(VALUE))" Q A
42+VER ;verify Routine file
43+ N DIR,DIRUT,X,Y
44+ W !,"I will delete all entries in the Routine File in which",!,"the Routine no longer exist on this system!",!
45+ S DIR(0)="Y",DIR("A")="OK to continue",DIR("B")="YES" D ^DIR
46+ Q:'Y!$D(DIRUT) D DELRTN
47+ W " ...Done.",!
48+ Q
49+DELRTN ;delete routine file entries
50+ N DA,DIK,Y
51+ S DIK="^DIC(9.8,",DA=0
52+ F S DA=$O(^DIC(9.8,DA)) Q:'DA S Y=$G(^(DA,0)) I $P(Y,U,2)="R",$T(^@$P(Y,U))="" D ^DIK
53+ Q
54+PURGE ;purge file
55+ N DA,DIK,DIR,DIRUT,X,XPD,XPDF,XPDI,XPDJ,XPDL,XPDN,XPDPG,XPDS,XPDUL,Y,Z
56+ S DIR("?")="Enter the file you want to purge the data from.",DIR(0)="SM^B:Build;I:Install;ALL:Build & Install",DIR("A")="Purge from what file(s)"
57+ D ^DIR Q:$D(DIRUT)
58+ S XPDF=$S(Y="I":9.7,1:9.6) S:Y="ALL" XPDF(1)=9.7
59+ K DIR S DIR("?")="Enter the number of Versions to keep in the file, for each package",DIR(0)="N^0:100:0",DIR("A")="Versions to Retain",DIR("B")=1
60+ D ^DIR Q:$D(DIRUT) S XPDN=Y
61+ K DIR
62+ S DIR(0)="FO^3:30",DIR("?")="^D PURGEH^XPDR",DIR("A")="Package Name",DIR("B")="ALL"
63+ F D ^DIR Q:$D(DIRUT) S XPD(X)="" Q:X="ALL" K DIR("B") S DIR("A")="Another Package Name"
64+ Q:'$D(XPD)
65+ ;if they want all, make sure all is the only one
66+ I $D(XPD("ALL")) K XPD S XPD("ALL")=""
67+ ;XPDF(1) is defined if doing both files, do purge twice
68+ K ^TMP($J) D PURGE1(XPDF),PURGE1($G(XPDF(1))):$D(XPDF(1))
69+ I '$D(^TMP($J)) W !!,"No match found" Q
70+ K XPD,DIR
71+ S DIR(0)="E",$P(XPDUL,"-",IOM)=""
72+ ;if ALL, reset XPDF to next file and Do, then reset back to 9.6
73+ D I $D(XPDF(1)) D ^DIR I Y S XPDF=XPDF(1) D S XPDF=9.6
74+ .S XPD="^TMP("_$J_","_XPDF,XPDS=XPD_",",XPD=XPD_")",XPDL=$L(XPDS),XPDPG=1,Y=1
75+ .W @IOF D HDR
76+ .;loop thru ^TMP($J,file,package) & show list, quit if user "^"
77+ .F S XPD=$Q(@XPD) Q:XPD=""!($E(XPD,1,XPDL)'=XPDS) D Q:'Y
78+ ..S Z=@XPD W $P(Z,"^"),$S($P(Z,"^",3):" (duplicates)",1:""),! Q:$Y<(IOSL-4)
79+ ..D ^DIR Q:'Y
80+ ..S XPDPG=XPDPG+1 W @IOF D HDR
81+ S DIR(0)="Y",DIR("A")="OK to DELETE these entries",DIR("B")="NO"
82+ W !! D ^DIR
83+ I $D(DIRUT)!'Y W !!,"Nothing Purged" Q
84+ ;loop thru and delete
85+ D I $D(XPDF(1)) S XPDF=XPDF(1) D
86+ .S DIK="^XPD("_XPDF_",",XPD="^TMP("_$J_","_XPDF,XPDS=XPD_",",XPD=XPD_")",XPDL=$L(XPDS)
87+ .F S XPD=$Q(@XPD) Q:XPD=""!($E(XPD,1,XPDL)'=XPDS) D
88+ ..S XPDI=@XPD F XPDJ=2:1 S DA=$P(XPDI,"^",XPDJ) Q:'DA D ^DIK
89+ Q
90+ ;
91+PURGE1(XPDF) ;XPDF=file #
92+ N XPDFL,XPDI,XPDJ,XPDP,XPDV,Y,Z
93+ W "."
94+ ;if All, loop thru B x-ref
95+ I $D(XPD("ALL")) D
96+ .S XPDI=""
97+ .F S XPDI=$O(^XPD(XPDF,"B",XPDI)) Q:XPDI="" D
98+ ..S X=$$PKG^XPDUTL(XPDI) D PURGE2(X)
99+ ..W "."
100+ E S XPDI="" F S XPDI=$O(XPD(XPDI)) Q:XPDI="" D
101+ .D PURGE2(XPDI)
102+ .W "."
103+ ;loop thru each package, XPDP=package name
104+ S XPDP="" F S XPDP=$O(^TMP($J,XPDF,XPDP)) Q:XPDP="" D
105+ .S XPDV="",XPDL=XPDN
106+ .;the last is the most recent, XPDN = number to retain, XPDV=version
107+ .;XPDS=type (T/V/Z)
108+ .F S XPDV=$O(^TMP($J,XPDF,XPDP,XPDV),-1),XPDS="" Q:'XPDV!'XPDL F S XPDS=$O(^TMP($J,XPDF,XPDP,XPDV,XPDS),-1) Q:XPDS=""!'XPDL D
109+ ..S Y="" F S Y=$O(^TMP($J,XPDF,XPDP,XPDV,XPDS,Y),-1) Q:Y=""!'XPDL D
110+ ...I $D(^TMP($J,XPDF,XPDP,XPDV,XPDS,Y))#2 K ^(Y) S XPDL=XPDL-1 Q
111+ ...S Z="" F S Z=$O(^TMP($J,XPDF,XPDP,XPDV,XPDS,Y,Z),-1) Q:Z=""!'XPDL K ^(Z) S XPDL=XPDL-1
112+ Q
113+ ;
114+PURGE2(XPDX) ;XPDX=package name
115+ ;XPDFL=1 this is not a patch, quit when we find a patch during loop
116+ S XPDS=XPDX,XPDL=$L(XPDX),XPDFL=XPDX'["*"
117+ ;loop and find matches
118+ D F S XPDS=$O(^XPD(XPDF,"B",XPDS)) Q:XPDS=""!($E(XPDS,1,XPDL)'=XPDX)!($S(XPDFL:XPDS["*",1:0)) D
119+ .S Y=$O(^XPD(XPDF,"B",XPDS,0)) Q:'Y
120+ .Q:'$D(^XPD(XPDF,Y,0)) S Z=^(0),Y=XPDS_"^"_Y
121+ .;can't delete Installs that status isn't 'Install Completed'
122+ .I XPDF=9.7 Q:$P(Z,U,9)<3
123+ .S XPDV=$$VER^XPDUTL(XPDS)
124+ .;TMP($J,file,package name,version,"*","T/V/Z",num,patch)=NAME^DA^duplicat DAs
125+ .I XPDS["*" D Q
126+ ..I XPDV?1.2N1"."1.2N S ^TMP($J,XPDF,$$PKG^XPDUTL(XPDS),+XPDV,"*Z",0,+$P(XPDS,"*",3))=Y_$$DUP(XPDS,$P(Y,"^",2)) Q
127+ ..I XPDV["T" S ^TMP($J,XPDF,$$PKG^XPDUTL(XPDS),+XPDV,"*T",+$P(XPDV,"T",2),+$P(XPDS,"*",3))=Y_$$DUP(XPDS,$P(Y,"^",2)) Q
128+ ..I XPDV["V" S ^TMP($J,XPDF,$$PKG^XPDUTL(XPDS),+XPDV,"*V",+$P(XPDV,"V",2),+$P(XPDS,"*",3))=Y_$$DUP(XPDS,$P(Y,"^",2)) Q
129+ ..S ^TMP($J,XPDF,$$PKG^XPDUTL(XPDS),+XPDV,"*",+$P(XPDS,"*",3))=Y_$$DUP(XPDS,$P(Y,"^",2))
130+ .;TMP($J,file,package name,version,"Z",0)=NAME^DA^duplicate DAs
131+ .I XPDV?1.2N1"."1.2N S ^TMP($J,XPDF,$$PKG^XPDUTL(XPDS),+XPDV,"Z",0)=Y_$$DUP(XPDS,$P(Y,"^",2)) Q
132+ .;TMP($J,file,package name,version,"T/V",num)=NAME^DA^dup DAs
133+ .I XPDV["T" S ^TMP($J,XPDF,$$PKG^XPDUTL(XPDS),+XPDV,"T",+$P(XPDV,"T",2))=Y_$$DUP(XPDS,$P(Y,"^",2)) Q
134+ .I XPDV["V" S ^TMP($J,XPDF,$$PKG^XPDUTL(XPDS),+XPDV,"V",+$P(XPDV,"V",2))=Y_$$DUP(XPDS,$P(Y,"^",2)) Q
135+ Q
136+PURGEH ;executable help from DIR call at PURGE+8
137+ W:$E(DIR("A"),1)="P" !,"Enter 'ALL' to purge all packages, or"
138+ W !,"Enter the name of the Package you want to Purge.",!," i.e. KERNEL 8.0 will purge version 8.0Tx and 8.0Vx",!," XU*8.0 will purge all patches for 8.0",!
139+ N DIR,X,Y
140+ S DIR(0)="Y",DIR("A")="Want to see the "_$S(XPDF=9.7:"Install File",$D(XPDF(1)):"Build & Install Files",1:"Build File")_" List",DIR("B")="Y"
141+ D ^DIR Q:'Y!$D(DIRUT)
142+ D PURGEH1("^XPD(9.6,"):XPDF=9.6,PURGEH1("^XPD(9.7,"):XPDF=9.7!$D(XPDF(1))
143+ Q
144+ ;
145+DUP(Z,Z1) ;find duplicate, Z=NAME, Z1=last ien
146+ ;returns Y=DA^dup DA^dup DA...
147+ N Y S Y=""
148+ F S Z1=$O(^XPD(XPDF,"B",Z,Z1)) Q:'Z1 S Y=Y_"^"_Z1
149+ Q Y
150+ ;
151+PURGEH1(DIC) ;
152+ W !!,$S(DIC[9.6:"BUILD ",1:"INSTALL ")_"File"
153+ S DIC(0)="QE",X="??" D ^DIC
154+ Q
155+ ;
156+HDR W !,"Package(s) in ",$S(XPDF=9.7:"INSTALL",1:"BUILD")," File, "
157+ I XPDN W "Retain last ",$S(XPDN=1:"version",1:XPDN_" versions")
158+ E W "Don't retain any versions"
159+ W ?70,"PAGE ",XPDPG,!,XPDUL,!
160+ Q

Subscribers

People subscribed via source and target branches