mirror of
https://github.com/abapGit/abapGit.git
synced 2025-05-01 04:08:27 +08:00
Restart abapGit in case of self-update (#3804)
* Restart abapGit in case of self-update Closes #3358 * Fix abapgit url detection Old logic incorrectly matched for example https://github.com/abapGit-tests/CHAR * Github only * Separate method Co-authored-by: Lars Hvam <larshp@hotmail.com>
This commit is contained in:
parent
44d4952d13
commit
e70875879b
|
@ -64,6 +64,15 @@ CLASS ZCL_ABAPGIT_URL IMPLEMENTATION.
|
|||
ENDMETHOD.
|
||||
|
||||
|
||||
METHOD is_abapgit_repo.
|
||||
|
||||
IF iv_url CS 'github.com' AND ( iv_url CP '*/abapGit' OR iv_url CP '*/abapGit.git' ).
|
||||
rv_abapgit = abap_true.
|
||||
ENDIF.
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
|
||||
METHOD name.
|
||||
|
||||
DATA: lv_path TYPE string.
|
||||
|
@ -118,15 +127,4 @@ CLASS ZCL_ABAPGIT_URL IMPLEMENTATION.
|
|||
iv_validate = abap_true ).
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
|
||||
METHOD is_abapgit_repo.
|
||||
|
||||
IF iv_url CS '/abapGit' OR iv_url CS '/abapGit.git'.
|
||||
rv_abapgit = abap_true.
|
||||
ENDIF.
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
|
||||
ENDCLASS.
|
||||
|
|
|
@ -203,6 +203,7 @@ CLASS zcl_abapgit_repo DEFINITION
|
|||
METHODS update_last_deserialize
|
||||
RAISING
|
||||
zcx_abapgit_exception .
|
||||
METHODS check_for_restart .
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
|
@ -244,6 +245,26 @@ CLASS ZCL_ABAPGIT_REPO IMPLEMENTATION.
|
|||
ENDMETHOD.
|
||||
|
||||
|
||||
METHOD check_for_restart.
|
||||
|
||||
CONSTANTS:
|
||||
lc_abapgit_prog TYPE progname VALUE `ZABAPGIT` ##NO_TEXT.
|
||||
|
||||
" If abapGit was used to update itself, then restart to avoid LOAD_PROGRAM_&_MISMATCH dumps
|
||||
" because abapGit code was changed at runtime
|
||||
IF zcl_abapgit_ui_factory=>get_gui_functions( )->gui_is_available( ) = abap_true AND
|
||||
zcl_abapgit_url=>is_abapgit_repo( ms_data-url ) = abap_true AND
|
||||
sy-batch = abap_false AND
|
||||
sy-cprog = lc_abapgit_prog.
|
||||
|
||||
MESSAGE 'abapGit was updated and will restart itself' TYPE 'I'.
|
||||
SUBMIT (sy-cprog).
|
||||
|
||||
ENDIF.
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
|
||||
METHOD constructor.
|
||||
|
||||
ASSERT NOT is_data-key IS INITIAL.
|
||||
|
@ -314,6 +335,8 @@ CLASS ZCL_ABAPGIT_REPO IMPLEMENTATION.
|
|||
|
||||
COMMIT WORK AND WAIT.
|
||||
|
||||
check_for_restart( ).
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user