;	EXECSLP.CMD
;
.ENABLE SUBSTITUTION
.SETT SKIP1
.SETT SKIP2
.SETT SKIP3
.SETT SKIP4
.SETT SKIP5
.SETT SKIP6
.DISABLE QUIET
;
; THIS FILE WILL ATTEMPT TO LEAD YOU THROUGH THE SYSGEN MODIFICATIONS
; AND EXECUTIVE SLP PATCHES.  WHEN IT IS DONE YOU SHOULD PERFORM A
; SYSGEN AND THEN REPEAT KMSGEN.CMD
;
; THE FILES 
;
;	1.  SYSGEN.SLP
;	2.  SGNTT.SLP
;	3.  SGNPER.SLP
;	4.  SGNEXEC.SLP
;	5.  TDSCH.SLP
;	6.  SYSCM.SLP
;
; THESE FILES ARE NORMALLY ON [344,65]
.SETS OURUIC <UIC>
.ASKUIC:
.ASKS FILUIC ON WHAT UIC ARE THE ABOVE FILES(<CR> DEFAULTS TO [344,65])
.IF FILUIC EQ "" .SETS FILUIC "[344,65]"
SET /UIC ='FILUIC'
.IF <EXSTAT> NE 1 ; YOU TYPED IN AN ILLEGAL UIC STRING TRY AGAIN
.IF <EXSTAT> NE 1 .GOTO ASKUIC
;
.ENABLE QUIET
SET /PRIV=TI:
.DISABLE QUIET
.IF <EXSTAT> NE 1 ; SORRY THIS UIC IS NOT PRIVLEGED, EXITING
.IF <EXSTAT> NE 1 /

.ENABLE QUIET
.SETS DSK <SYDISK>+"'<SYUNIT>'"+":"
.ASKS TEMP WHICH DEVICE IS THE EXECUTIVE SOURCE DISK( <CR>-EXIT, DDU:)
.IF TEMP EQ "" /
.SETS $EXC TEMP[1:3]
.ASKS TEMP WHICH DEVICE IS SYSGEN.CMD ON(<CR>-EXIT, DDU:)
.IF TEMP EQ "" /
.SETS $LBX TEMP[1:3]
.SETS UIC <UIC>
ASN '$EXC':=SY:
SET /UIC=[11,10]

.PTCH0A:.TESTFILE TDSCH.MAC;1
.IF <FILERR> EQ 1 .SETF SKIP1		! IF EQ YES IT DOES EXIST
.IFF SKIP1 .GOTO PATCH1			! IFF, IT EXISTS, GO RENAME IT
.; IF IT DOESN'T, MAYBE ALREADY RENAMED
.TESTFILE TDSCH.VGN;1
.IF <FILERR> EQ 1 .SETF SKIP1		! IF EQ, IT HAS BEEN RENAMED
.IFF SKIP1 .GOTO PTCH1A			! IFF, HAS BEEN RENAMED, SKIP RENAME
.; 
.; AT THIS POINT THE FILE NEITHER EXISTS, NOR HAS IT ALREADY BEEN RENAMED
.DISABLE QUIET
;
; TDSCH.MAC;1 IS NOT ON THIS DEVICE/UIC.
; >>>>WARNING, THE FIRST PATCH FAILED
.ENABLE QUIET
.PATCH1: .IFF SKIP1 PIP TDSCH.VGN/RE=TDSCH.MAC;1	! RENAME THE FILE
 
 
.; SEE IF FILE EXISTS
.PTCH1A:.TESTFILE SYSCM.MAC;1
.IF <FILERR> EQ 1 .SETF SKIP2		! IF EQ YES IT DOES
.IFF SKIP2 .GOTO PATCH2			! IFF, IT EXISTS, GO RENAME IT
.TESTFILE SYSCM.VGN;1
.IF <FILERR> EQ 1 .SETF SKIP2		! IF EQ, IT HAS BEEN RENAMED
.IFF SKIP2 .GOTO PTCH2A			! IFF, HAS BEEN RENAMED, SKIP RENAME
.; 
.; AT THIS POINT THE FILE NEITHER EXISTS, NOR HAS IT ALREADY BEEN RENAMED
.DISABLE QUIET
;
; SYSCM.MAC;1 IS NOT ON THIS DEVICE/UIC.
; >>>>WARNING, THE SECOND PATCH FAILED
.ENABLE QUIET
.PATCH2: .IFF SKIP2 PIP SYSCM.VGN/RE=SYSCM.MAC;1	! RENAME THE FILE
 
 
 
.PTCH2A:
.;
.; TRANSFER FILES OVER TO THE EXEC SOURCE DISK
.;
SET /UIC=[11,40]
PIP SY:/NV='DSK''UIC'TDSCH.SLP,SYSCM.SLP
.IFNINS SLP INS $SLP
SET /UIC=[11,10]
.IFF SKIP1 SLP @[11,40]SYSCM.SLP
.IFF SKIP2 SLP @[11,40]TDSCH.SLP
.;
.; CHECK FOR CORRECT COMMAND FILES FOR SYSGEN
.;
SET /UIC=[200,200]
ASN '$LBX':=SY:
 
 
.; DO REQUIRED COMMAND FILES EXIST
.TESTFILE SGNEXEC.CMD;1
.IF <FILERR> EQ 1 .SETF SKIP3		! IF EQ YES IT DOES
.IFF SKIP3 .GOTO PATCH3			! IFF, IT EXISTS, GO RENAME IT
.TESTFILE SGNEXEC.VMD;1
.IF <FILERR> EQ 1 .SETF SKIP3		! IF EQ, IT HAS BEEN RENAMED
.IFF SKIP3 .GOTO PTCH3A			! IFF, HAS BEEN RENAMED, SKIP RENAME
.; 
.; AT THIS POINT THE FILE NEITHER EXISTS, NOR HAS IT ALREADY BEEN RENAMED
.DISABLE QUIET
;
; SGNEXEC.CMD;1 IS NOT ON THIS DEVICE/UIC.
; >>>>WARNING, THE THIRD PATCH FAILED
.ENABLE QUIET
.PATCH3: .IFF SKIP3 PIP SGNEXEC.VMD/RE=SGNEXEC.CMD;1	! RENAME THE FILE
.PTCH3A:.TESTFILE SGNPER.CMD;1
.IF <FILERR> EQ 1 .SETF SKIP4		! IF EQ YES IT DOES
.IFF SKIP4 .GOTO PATCH4			! IFF, IT EXISTS, GO RENAME IT
.TESTFILE SGNPER.VMD;1
.IF <FILERR> EQ 1 .SETF SKIP4		! FILE HAS ALREADY BEEN RENAMED
.IFF SKIP4 .GOTO PTCH4A
.;
.; AT THIS POINT THE FILE NEITHER EXISTS NOR HAS IT ALREADY BEEN RENAMED
.DISABLE QUIET
;
; SGNPER.CMD IS NOT ON THIS DEVICE/UIC.
; >>>>WARNING THE FOURTH PATCH FAILED
.ENABLE QUIET
.PATCH4:.IFF SKIP4 PIP SGNPER.VMD;1/RE=SGNPER.CMD;1
.PTCH4A:.TESTFILE SGNTT.CMD;1
.IF <FILERR> EQ 1 .SETF SKIP5		! IF EQ YES IT DOES
.IFF SKIP5 .GOTO PATCH5			! IFF, IT EXISTS, GO RENAME IT
.TESTFILE SGNTT.VMD;1
.IF <FILERR> EQ 1 .SETF SKIP5		! IF EQ, IT HAS BEEN RENAMED
.IFF SKIP5 .GOTO PTCH5A			! IFF, HAS BEEN RENAMED, SKIP RENAME
.; 
.; AT THIS POINT THE FILE NEITHER EXISTS, NOR HAS IT ALREADY BEEN RENAMED
.DISABLE QUIET
;
; SGNTT.CMD;1 IS NOT ON THIS DEVICE/UIC.
; >>>>WARNING, THE FIFTH PATCH FAILED
.ENABLE QUIET
.PATCH5: .IFF SKIP5 PIP SGNTT.VMD/RE=SGNTT.CMD;1	! RENAME THE FILE
ASN '$LBX':=SY:
 
 
.PTCH5A:.TESTFILE SYSGEN.CMD;1
.IF <FILERR> EQ 1 .SETF SKIP6		! IF EQ YES IT DOES
.IFF SKIP6 .GOTO PATCH6			! IFF, IT EXISTS, GO RENAME IT
.TESTFILE SYSGEN.VMD;1
.IF <FILERR> EQ 1 .SETF SKIP6		! IF EQ, IT HAS BEEN RENAMED
.IFF SKIP6 .GOTO CPY			! IFF, HAS BEEN RENAMED, SKIP RENAME
.; 
.; AT THIS POINT THE FILE NEITER EXISTS, NOR HAS IT ALREADY BEEN RENAMED
.DISABLE QUIET
;
; SYSGEN.CMD;1 IS NOT ON THIS DEVICE/UIC.
; >>>>WARNING, THE SIXTH PATCH FAILED
.ENABLE QUIET
.PATCH6: .IFF SKIP6 PIP SYSGEN.VMD/RE=SYSGEN.CMD;1	! RENAME THE FILE
 
 
 
.CPY:PIP SY:/NV='DSK''UIC'SYSGEN.SLP
.IFF SKIP6 SLP @SYSGEN.SLP
ASN '$LBX':=SY:
PIP SY:/NV='DSK''UIC'SGNEXEC.SLP,SGNPER.SLP,SGNTT.SLP
.IFF SKIP3 SLP @SGNEXEC.SLP
.IFF SKIP4 SLP @SGNPER.SLP
.IFF SKIP5 SLP @SGNTT.SLP
.DISABLE QUIET
.IFT SKIP1 .OR .IFT SKIP1 .OR .IFT SKIP3 .OR .IFT SKIP4 .SETF ALLDON
.IFT SKIP5 .OR .IFT SKIP6 .SETF ALLDON
;
.IFF ALLDON .GOTO BADBAD
; THE END OF THE EXEC SLP MODIFICATIONS AND THE SYSGEN COMMAND
; FILE MODIFICATIONS.  NOW DO A SYSGEN BEFORE PROCEEDING WITH 
; KMSGEN.
;
SET /UIC ='OURUIC'
ASN 'DSK'=SY:
/
.BADBAD:;  ONE OR MORE OF YOUR EXECUTIVE MODULES OR SYSGEN COMMAND FILES
; HAS NOT BEEN UPDATED.  FIND OUT WHY AND FIX THE PROBLEM.
SET /UIC ='OURUIC'
ASN 'DSK'=SY:
