Subversion Repositories DevTools

Rev

Rev 6698 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6698 Rev 6924
Line 29... Line 29...
29
    last_resultCode = -1
29
    last_resultCode = -1
30
    last_errorMsg = ""
30
    last_errorMsg = ""
31
End Sub
31
End Sub
32
 
32
 
33
'-----------------------------------------------------------------------------------------------------------------
33
'-----------------------------------------------------------------------------------------------------------------
-
 
34
'   Queue up an action to be performed by a task running on the pkg_archive server
-
 
35
'   Decouples the Database from the filserver
-
 
36
'
-
 
37
Private Sub trigger_action(rtag_id, pv_id, sChange)
-
 
38
 
-
 
39
'    OraDatabase.Parameters.Add "RTAG_ID",  rtag_id,    ORAPARM_INPUT, ORATYPE_NUMBER
-
 
40
'    OraDatabase.Parameters.Add "PV_ID",    pv_id,      ORAPARM_INPUT, ORATYPE_NUMBER
-
 
41
'    OraDatabase.Parameters.Add "MODE",     sChange,    ORAPARM_INPUT, ORATYPE_VARCHAR2
-
 
42
'    OraDatabase.Parameters.Add "USER_ID",  objAccessControl.UserId, ORAPARM_INPUT, ORATYPE_NUMBER
-
 
43
'
-
 
44
'
-
 
45
'    objEH.ErrorRedirect = FALSE
-
 
46
'    objEH.TryORA ( OraSession )
-
 
47
'    On Error Resume Next
-
 
48
'
-
 
49
'    OraDatabase.ExecuteSQL "BEGIN PK_TRIGGERS.log_action( :RTAG_ID, :PV_ID, :MODE, :USER_ID, null);END;"
-
 
50
'
-
 
51
'    objEH.CatchORA ( OraSession )
-
 
52
'
-
 
53
'    OraDatabase.Parameters.Remove "RTAG_ID"
-
 
54
'    OraDatabase.Parameters.Remove "PV_ID"
-
 
55
'    OraDatabase.Parameters.Remove "MODE"
-
 
56
'    OraDatabase.Parameters.Remove "USER_ID"
-
 
57
'
-
 
58
'    If objEH.LastOraFailed Then
-
 
59
'       Report_Event enumEVENT_ERROR, "trigger_action", objEH.MessageSummary, objEH.MessageDetails
-
 
60
'    End If
-
 
61
 
-
 
62
End Sub
-
 
63
 
-
 
64
'-----------------------------------------------------------------------------------------------------------------
34
' Retrieves package infomation for the specified package version
65
' Retrieves package infomation for the specified package version
35
' This information is required for the make_release_changed script
66
' This information is required for the make_release_changed script
36
Public Sub Get_Package_Info (artag_id,apv_id)
67
Public Sub Get_Package_Info (artag_id,apv_id)
37
   Dim ssql, rsTemp
68
   Dim ssql, rsTemp
38
   On Error Resume Next
69
   On Error Resume Next
Line 122... Line 153...
122
    If not m_data_collected Then
153
    If not m_data_collected Then
123
        Report_Event enumEVENT_ERROR, "make_release_changed", "", "Package Info not present"
154
        Report_Event enumEVENT_ERROR, "make_release_changed", "", "Package Info not present"
124
        Exit Sub
155
        Exit Sub
125
    End If
156
    End If
126
 
157
 
127
    '   Don't run the release change notification if the package has not been released
-
 
128
    '   Trying to prevent WIP packages being sent via blat
-
 
129
    If m_dlocked <> "Y" Then
-
 
130
        Exit Sub
-
 
131
    End If
-
 
132
 
-
 
133
    ' Build up the command line to the target script
158
    ' Build up the command line to the target script
134
    ' Note: DoubleQuotes quotes will be escaped \"
159
    ' Note: DoubleQuotes quotes will be escaped \"
135
    '       Double space will be process as <ret> for error reporting
160
    '       Double space will be process as <ret> for error reporting
136
    ' Chr(92) == \
161
    ' Chr(92) == \
137
    ' Chr(34) == "
162
    ' Chr(34) == "
Line 157... Line 182...
157
    Else
182
    Else
158
        last_resultCode = 1
183
        last_resultCode = 1
159
        Report_Event enumEVENT_ERROR, "make_release_changed", Replace(sudoCmd,"  ", VBNewLine), "Remote command on pkg server reported:"  & rv
184
        Report_Event enumEVENT_ERROR, "make_release_changed", Replace(sudoCmd,"  ", VBNewLine), "Remote command on pkg server reported:"  & rv
160
    End If
185
    End If
161
 
186
 
-
 
187
    '
-
 
188
    '   New mechanism
-
 
189
    '   Create an action trigger
-
 
190
    '
-
 
191
    Dim sMode
-
 
192
    If amode_id =  enumRELEASE_CHANGE_MODE_PKG_ADDED Then
-
 
193
        sMode = "add"
-
 
194
    ElseIf amode_id =  enumRELEASE_CHANGE_MODE_PKG_REMOVED Then
-
 
195
        sMode = "delete"
-
 
196
    Else
-
 
197
        sMode = "new_version"
-
 
198
    End If
-
 
199
         
-
 
200
    Call trigger_action (artag_id, apv_id, sMode)
-
 
201
 
162
End Sub
202
End Sub
163
 
203
 
164
'-----------------------------------------------------------------------------------------------------------------------------
204
'-----------------------------------------------------------------------------------------------------------------------------
165
' Get the package are in which the package version resides (ie wip, planned, released)
205
' Get the package are in which the package version resides (ie wip, planned, released)
166
Function Get_Pkg_Area (artagId, apvId)
206
Function Get_Pkg_Area (artagId, apvId)
Line 255... Line 295...
255
    Else
295
    Else
256
        last_resultCode = 1
296
        last_resultCode = 1
257
        Report_Event enumEVENT_ERROR, "make_writable", Replace(sudoCmd,"  ", VBNewLine), "Remote command on pkg server reported:"  & rv
297
        Report_Event enumEVENT_ERROR, "make_writable", Replace(sudoCmd,"  ", VBNewLine), "Remote command on pkg server reported:"  & rv
258
    End If
298
    End If
259
 
299
 
-
 
300
    '
-
 
301
    '   New mechanism
-
 
302
    Call trigger_action (artag_id, apv_id, "make_writable")
-
 
303
 
260
End Sub
304
End Sub
261
 
305
 
262
'-----------------------------------------------------------------------------------------------------------------
306
'-----------------------------------------------------------------------------------------------------------------
263
'   Make the Package UnWritable
307
'   Make the Package UnWritable
264
'   Primary Purpose is to make a 'Patch' wriable in dpkg_archive
308
'   Primary Purpose is to make a 'Patch' wriable in dpkg_archive
Line 305... Line 349...
305
    Else
349
    Else
306
        last_resultCode = 1
350
        last_resultCode = 1
307
        Report_Event enumEVENT_ERROR, "make_readonly", Replace(sudoCmd,"  ", VBNewLine), "Remote command on pkg server reported:"  & rv
351
        Report_Event enumEVENT_ERROR, "make_readonly", Replace(sudoCmd,"  ", VBNewLine), "Remote command on pkg server reported:"  & rv
308
    End If
352
    End If
309
 
353
 
-
 
354
    '
-
 
355
    '   New mechanism
-
 
356
    Call trigger_action (artag_id, apv_id, "make_readonly")
-
 
357
 
310
End Sub
358
End Sub
311
 
359
 
312
'-----------------------------------------------------------------------------------------------------------------
360
'-----------------------------------------------------------------------------------------------------------------
313
'   Run a remote command in an ssh session
361
'   Run a remote command in an ssh session
314
'
362
'