source: WorldVistAEHR/trunk/r/KERNEL-XU-A4A7-USC-XG-XLF-XNOA-XPD-XQ-XVIR-ZI-ZOSF-ZOSV-ZT-ZU-%Z-XIP--XQAB--XUC--XUR--ZIN--ZTED/XPDZPRE1.m@ 738

Last change on this file since 738 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 8.0 KB
Line 
1XPDZPRE1 ;FGO/JHS; Pre-Install Patch Check ; 8/19/03 11:03am
2 ;;8.0;KERNEL;**L33**;Jul 10, 1995
3VERS W !,"Checking if Patch is for Current Version of Package."
4 I AAQP2="DBA" W !!,"DBA Patches are not checked for Current Version." G INST
5 S AAQX=AAQP1 S:AAQP1["Z" AAQX=$P(AAQP1,"Z")
6 I '$D(^DIC(9.4,"C",AAQP1)) D RV1NOTE W "Sorry. Package couldn't be found with "_AAQP1_" Prefix." G VERERR
7 D VERSION
8 I AAQP2=VERSION W !,"Current Version "_VERSION_" agrees with this Patch."
9 E D RV1NOTE W "Current Version "_VERSION_" does NOT agree with this Patch." S AAQVERR=1
10 S AAQPKG=$P(^DIC(9.4,IFN,0),U) W !,AAQPKG," Version ",VERSION," was installed "_$$FMTE^XLFDT(DATE),".",! G INST
11VERERR S AAQVERR=1
12INST I '$D(^XPD(9.7,"B",AAQP)) W !,"There is No Record in the INSTALL File",!,"of this Patch being previously installed.",! G SEQ
13 S AAQIN=0,AAQIN=$O(^XPD(9.7,"B",AAQP,AAQIN)) S AAQINDT=$P($G(^XPD(9.7,AAQIN,1)),U,3) I AAQINDT="" G NOTIN
14 S AAQDUZ=$P($G(^XPD(9.7,AAQIN,0)),U,11) I AAQDUZ="" S AAQDUZ="Unknown" G SETCOM
15 S AAQDUZ=$P(^VA(200,AAQDUZ,0),U,1)
16SETCOM S AAQCOM=^XPD(9.7,AAQIN,2)
17 S AAQINDT=$$FMTE^XLFDT(AAQINDT)
18 D RV1NOTE W "INSTALL file shows at least one ",AAQP," already installed." S AAQIERR=1
19 W !,"First installed ",AAQINDT," by ",AAQDUZ,"."
20 W !,"Partial Install Comment: ",$E(AAQCOM,1,40),! G SEQ
21NOTIN W !,"Install Complete Time for this patch was not found in INSTALL file.",!
22SEQ I IOST["C-",$Y>(IOSL-4) R !," Press RETURN to Continue: ",AAQX:20 S $Y=0 W !
23 G:AAQU="VAH" CHKSEQ
24 W !,"The Pre-Install Checks for Sequence Number and Associated Patches",!,"can only be done with the Patch Record in the VAH account." Q
25CHKSEQ W !,"Checking the Patch Sequence Numbers for the correct order."
26 I AAQSEQ=0 D RV1NOTE W "This patch has SEQ #0. Sequence Numbers cannot be checked." G SEQBAD
27 S AAQSQSV=0,AAQZN=0
28 S X=AAQP12,DIC="^DIZ(437016," S DIC(0)="XM" D ^DIC S AAQPV=+Y
29 I Y=-1 D RV1NOTE W "This PKG*VER is not found in the Patch Record.",!,"The Patch Sequence number will not be checked." G ASSOC
30 F K=0:0 S AAQZN=$O(^DIZ(437016,AAQPV,1,AAQZN)) Q:AAQZN="B" D
31 .I AAQZN="" W !,"This appears to be the first patch for the PKG*VER, so SEQ# cannot be checked." G ASSOC
32 .S AAQSQ=$P($G(^DIZ(437016,AAQPV,1,AAQZN,0)),U,3)
33 .S AAQPNO=$P(^DIZ(437016,AAQPV,1,AAQZN,0),U)
34 .I AAQSQ=AAQSEQ D RV1NOTE W "SEQ #",AAQSEQ," has already been entered for the ",AAQP12," package." S AAQSERR=1 Q
35 .I AAQSQ>AAQSQSV S AAQSQSV=AAQSQ,AAQPNSV=AAQPNO
36 I AAQSQSV=0,AAQSEQ=1 S AAQSQSV=AAQSEQ,AAQPNSV=AAQP3 G SEQ1
37 I AAQSERR=1 G SEQBAD
38 I AAQSQSV=0,AAQSEQ'=1 D RV1NOTE W "The Sequence Number for Patch ",AAQP," cannot be checked.",!,"There are no SEQ #'s for the ",AAQP12," package in the Patch Record." G SEQBAD
39SEQ1 W !,"Patch #",AAQPNSV," with SEQ #",AAQSQSV," has the highest Sequence Number." G:AAQSEQ=1 ASSOC
40 S AAQAP2=AAQP3 I $L(AAQP3)<2 S AAQAP2="0"_AAQP3
41 W !,"Patch #",AAQP3," with SEQ #",AAQSEQ," is being compared for pre-install."
42 I AAQSQSV=AAQSEQ D RV1NOTE W !,"The highest SEQ # installed is equal to the SEQ # for this patch." G SEQBAD
43 S AAQSQ=AAQSEQ-AAQSQSV I AAQSQ'=1 D RV1NOTE W "The difference between these Sequence Numbers is not equal to 1.",!,"It appears something may have been installed out of sequence." G SEQBAD
44 W !,"Patch ",AAQP," is OK for the sequence number order." G ASSOC
45SEQBAD W !,"Patch ",AAQP," may have a problem with sequence number order." S AAQSERR=1
46ASSOC S AAQAP="No Associated patches found in Message." Q:AAQXMZ'>0
47 S AAQLINE=0 W !!,"Looking for Associated patches."
48GETAP S AAQLINE=$O(^XMB(3.9,AAQXMZ,2,AAQLINE)) Q:AAQLINE="" S AAQTXT=^XMB(3.9,AAQXMZ,2,AAQLINE,0)
49 Q:$E(AAQTXT,1,4)="$END" ;Quit for PackMan Patch Message
50 Q:AAQTXT["Released By" ;Quit for FTP Patch Message
51 I AAQTXT["(v)" S AAQAP=$P(AAQTXT,"(v)",2) S AAQAP=$P(AAQAP," ") S AAQAP=$P(AAQAP,"<<") W !!,AAQAP D CHKAP
52 I AAQTXT["(u)" S AAQAP=$P(AAQTXT,"(u)",2) S AAQAP=$P(AAQAP," ") S AAQAP=$P(AAQAP,"<<") W !!,AAQAP D CHKAP
53 I IOST["C-",$Y>(IOSL-4) R !," Press RETURN to Continue: ",AAQX:20 S $Y=0 W !
54 G GETAP
55CHKAP I '$D(^DIZ(437016,0)) Q ;Check Patch Record
56 I AAQU'="VAH" W !,"Patch Record can only be checked in VAH." Q ;Could check #9.7 in TST, but data may be unreliable after Restore/Reset
57 ;;I '$D(^DIZ(437016,"B",AAQP12)) D RV1NOTE W "This PKG*VER is not found in the Patch Record." S AAQAERR=1 Q
58 S X=AAQP12,DIC="^DIZ(437016," S DIC(0)="XM" D ^DIC S AAQPV=+Y
59 S AAQDL="*",AAQAP1=$P(AAQAP,"*",1),AAQAP2=$P(AAQAP,"*",2),AAQDLX=AAQAP2_AAQDL,AAQAP3=$P(AAQAP,AAQDLX,2)
60 I $L(AAQAP3)<2 S AAQAP3="0"_AAQAP3
61 I $E(AAQAP2,1,1)="." S AAQAP2="0"_AAQAP2
62 G:AAQAP2="DBA" SX12
63 I AAQAP2'["." S AAQAP2=AAQAP2_".0"
64SX12 S AAQX12=AAQAP1_AAQDL_AAQAP2,AAQX3=AAQX12_AAQDL_AAQAP3
65 S X=AAQX12,DIC="^DIZ(437016," S DIC(0)="XM" D ^DIC S AAQPV=+Y
66 S X=AAQAP3,DIC="^DIZ(437016,AAQPV,1," S DIC(0)="XM" D ^DIC S AAQPNO=+Y
67 I Y=-1 D RV15NOTE W "Patch #"_AAQAP3_" is not found in the Patch Record." S AAQAERR=1 Q
68 W ?15,"SEQ #",$P($G(^DIZ(437016,AAQPV,1,AAQPNO,0)),U,3)
69 S AAQX=0 W ?25,$P(^DIZ(437016,AAQPV,1,AAQPNO,0),U,2)
70 ; Changed following line fr AAQX="" to (+AAQX'>0) L33/JFW
71 F S AAQX=$O(^DIZ(437016,AAQPV,1,AAQPNO,2,AAQX)) Q:(+AAQX'>0) D
72 .S AAQSYS=^DIZ(437016,AAQPV,1,AAQPNO,2,AAQX,0)
73 .S AAQDT=$P(^DIZ(437016,AAQPV,1,AAQPNO,2,AAQX,0),U,2)
74 .S AAQIRM=$P(^DIZ(437016,AAQPV,1,AAQPNO,2,AAQX,0),U,3)
75 .I $E(AAQSYS,1,1)="T" S AAQSYSX="TST"
76 .I $E(AAQSYS,1,1)="V" S AAQSYSX="VAH"
77 .W !,?25,"Installed in ",AAQSYSX," on ",$$FMTE^XLFDT(AAQDT)," by ",AAQIRM
78 Q
79VERSION ;Version & Date code from A5CSTAU; SLC/STAFF
80 S IFN=+$O(^DIC(9.4,"C",AAQX,0))
81 S VERSION=$G(^DIC(9.4,IFN,"VERSION"))
82 S DATE=$$DATE(IFN,VERSION)
83 ; if package installed but no 'CURRENT VERSION' in Package file
84 I VERSION,'DATE S DATE=$$DATE(IFN,VERSION)
85 I 'DATE,VERSION,VERSION'[".",VERSION=+VERSION S VERSION=VERSION_".0",DATE=$$DATE(IFN,VERSION)
86 Q
87DATE(IFN,VERSION) ; $$(package ifn,version) -> date of install
88 N IFN1
89 I 'VERSION Q ""
90 S IFN1=+$O(^DIC(9.4,IFN,22,"B",VERSION,0))
91 Q $P($G(^DIC(9.4,IFN,22,IFN1,0)),U,3)
92LKUP S X=AAQP12,DIC="^DIZ(437016,",DIC(0)="XM" D ^DIC I +Y>0 S AAQPV=+Y
93 I '$D(^DIZ(437016,"B",AAQP12)) D
94 .S X=AAQP12,DIC="^DIZ(437016," S DIC(0)="ML" D FILE^DICN
95 .S AAQPV=+Y
96 I $L(AAQP3)<2 S AAQP3="0"_AAQP3
97 S AAQPNO=AAQP3
98 I $D(^DIZ(437016,AAQPV,1,"B",AAQP3)) S DA=0,DA=$O(^DIZ(437016,AAQPV,1,"B",AAQP3,DA)) S AAQPNO=DA,DA(1)=AAQPV,DIC="^DIZ(437016,"_DA(1)_",1," G CKFWD
99 I '$D(^DIZ(437016,AAQPV,1,"B",AAQP3)) D
100 .S:'$D(^DIZ(437016,AAQPV,1,0)) DIC("P")=$P(^DD(437016,1,0),"^",2)
101 .S DA(1)=AAQPV,DIC="^DIZ(437016,"_DA(1)_",1,",X=AAQP3,DIC(0)="L",DLAYGO=437016
102 .D ^DIC S AAQPNO=+Y
103CKFWD I AAQRL="F"!"R" D FWD
104 G:'$D(^VA(200,"B","PATCHES,ALL D")) UPDT
105 G:'$D(XMZ) UPDT
106 S XMY("PATCHES,ALL D")="" D ENT1^XMD
107 W !!,"Forwarding message #"_XMZ_" to PATCHES,ALL D."
108UPDT W !!,"Doing Partial Update of the Patch Record now."
109 K DD,D0 S DIE=DIC,DA=AAQPNO,DR="1.43///^S X=AAQXMZ;1.44///^S X=AAQBAK" D ^DIE
110 I AAQRL="F",AAQINST=1 K DD,D0 S DIE=DIC,DA=AAQPNO,DR="1.3///^S X=AAQSEQ" D ^DIE ;To avoid warning, update SEQ# only when called by XPDZPAT
111 S:AAQRL="F" AAQX="NI" S:AAQRL="I" AAQX="IN" S:AAQP2="DBA" AAQX="FM" K DD,D0 S DIE=DIC,DA=AAQPNO,DR="1.5///^S X=AAQX" D ^DIE
112 I AAQP2="DBA" S AAQRL="P" D ^XPDZUPDT G KILD
113 I AAQRL="I" D SETX^XPDZUPDT G KILD
114 S AAQLN=1 D CHKL^XPDZUPDT
115KILD K D,D0,DA,DDER,DI,DIE,DQ,DR
116 Q ;Other variables killed by XPDZPRE or XPDZPAT
117FWD D GETENV^%ZOSV S AAQUCI=$P(Y,"^",1),AAQSITE=^XMB("NETNAME") ;L33
118 S AAQR=$G(^%ZOSF("VOL")) ;Pick up volume such as ROU,LOU,COU...
119 I AAQU="VAH" S AAQSITE=^XMB("NETNAME"),AAQSITE="TEST."_^XMB("NETNAME"),AAQXMY=$P(^VA(200,DUZ,0),"^",1)_"@"_AAQSITE
120 I AAQU="VAH",(AAQR="ROU"),(AAQXMY'["TEST.TEST"),(AAQXMY'["VISN13-APPS"),(AAQXMY'["CENTRAL-PLAINS") S XMY(AAQXMY)="" D ENT1^XMD W !!,"Forwarding message #"_XMZ_" to "_AAQXMY
121 I AAQU="VAH",(AAQXMY["VISN13-APPS") S $P(AAQXMY,"@",2)="TEST.V23IRM.VA.GOV" S XMY(AAQXMY)="" D ENT1^XMD W !!,"Forwarding message #"_XMZ_" to "_AAQXMY ;Added line 07-30-2003/JFW MPLS
122 I AAQU="VAH",(AAQXMY["CENTRAL-PLAINS") S $P(AAQXMY,"@",2)="TEST.VISN14.MED.VA.GOV" S XMY(AAQXMY)="" D ENT1^XMD W !!,"Forwarding message #"_XMZ_" to "_AAQXMY ;Added line 08-19-2003/JFW MPLS
123 Q
124RV1NOTE W !,@RV1,"NOTE:",@RV0,$C(7)," " Q
125RV15NOTE W ?15,@RV1,"NOTE:",@RV0,$C(7)," " Q
Note: See TracBrowser for help on using the repository browser.