Faculty of Information Technology
Software Engineering Group

Ticket #172: smalltalk_fix_1_of_1_rev_1e9a3f3d494a_Issue___172_StX_fails_to_start_on_Windows_when_launcher_script_is_run_from_different_directory.patch

File smalltalk_fix_1_of_1_rev_1e9a3f3d494a_Issue___172_StX_fails_to_start_on_Windows_when_launcher_script_is_run_from_different_directory.patch, 1.9 KB (added by Patrik Svestka, 3 years ago)

fixing configuration file path

  • smalltalk.bat

    # HG changeset patch
    # User Patrik Svestka <patrik.svestka@gmail.com>
    # Date 1502882588 -7200
    #      Wed Aug 16 13:23:08 2017 +0200
    # Branch jv
    # Node ID 1e9a3f3d494a49bf68be347c6a4eebc7237ee45e
    # Parent  97b3ca922cb1beaeeff4829fc07aa54ca2d68dce
    Issue: #172 StX fails to start on Windows when launcher script is run from different directory
    
    Version: 1.5.1
    The patch addresses missing configuration path.  Only the configuration file (*.cfg) was talken without any path.
    Worked as the smalltalk.bat is in the same directory, but if executed outside the directory it stopped working.
    
    https://swing.fit.cvut.cz/projects/stx-jv/ticket/172
    
    diff -r 97b3ca922cb1 -r 1e9a3f3d494a smalltalk.bat
    a b  
    5353:: Versions =
    5454:: ==========
    5555:: This script
    56 SET batch_script_version=1.5.0
     56SET batch_script_version=1.5.1
    5757:: Smalltalk/X
    5858SET stx_version=6.2.6
    5959
     
    147147:: The reason is that it is before the validation process
    148148SET "configuration_file_path=%~dp0"
    149149SET "configuration_file=smalltalk.cfg"
    150 IF NOT EXIST !configuration_file_path!!configuration_file! (
     150SET "configuration_file_with_path=!configuration_file_path!!configuration_file!"
     151IF NOT EXIST !configuration_file_with_path! (
    151152    SET "message="Smalltalk configuration file: !configuration_file! not found. Fix it.""
    152153    SET __numeric.exit_value=1
    153154    CALL :exit_sequence !message!
     
    156157
    157158:: EOL stops comments from being parsed
    158159:: otherwise split lines at the = char into two tokens
    159 FOR /F "EOL=# delims== tokens=1,*" %%A IN (!configuration_file!) DO (
     160FOR /F "EOL=# delims== tokens=1,*" %%A IN (!configuration_file_with_path!) DO (
    160161    REM proper lines have both a and b set
    161162    REM if okay, assign property to some kind of namespace
    162163    REM so some.property becomes test.some.property in batch-land