Ignore:
Timestamp:
Jun 12, 2018, 3:01:06 PM (3 years ago)
Author:
Herwig Bauernfeind
Message:

Unify debug formatting

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/guitools/shared/nlv.vrs

    r990 r1055  
    2424    parse var execDir srchroot '\BIN'
    2525
    26     say '  NLV execDir    = "'execDir'"'
    27     say '  NLV srchroot   = "'srchRoot'"'
     26    if options.!debug = 1 then say '  NLV execDir    = "'execDir'"'
     27    if options.!debug = 1 then say '  NLV srchroot   = "'srchRoot'"'
    2828
    2929    filestem = VRParseFileName( execPath, "N")
     
    3333        otherwise filestem = strip(SUBSTR( filestem, 1, 5 ))||'_'
    3434    end
    35     say '  NLV filestem   = "'filestem'"'
     35    if options.!debug = 1 then say '  NLV filestem   = "'filestem'"'
    3636
    3737    /* First, figure out what language/message file to use */
     
    5555/*:VRX         NLVSearch
    5656*/
    57 NLVSearch: procedure expose filestem execdir srchroot
     57NLVSearch: procedure expose filestem execdir srchroot options.
    5858    nlv     = arg(1)
    5959    SubDir  = arg(2)
     
    6464    UnixRoot = value("UNIXROOT",,"OS2ENVIRONMENT")
    6565    do until NLVSrchDone = 1
    66         say '  NLV 'Suffix' file   = "'filestem||nlv'.'Suffix'"'
     66        IF options.!debug == 1 then say '  NLV 'Suffix' file   = "'filestem||nlv'.'Suffix'"'
    6767        select
    6868            when VRFileExists(execdir'\'filestem||nlv'.'Suffix) then do
    69                 say "  Attempt1: NLV "Suffix" file found directly!"
     69                IF options.!debug == 1 then say "  Attempt1: NLV "Suffix" file found directly!"
    7070                NLVFile = strip(execdir'\'filestem||nlv'.'Suffix,'L','\')
    7171                NLVSrchDone = 1
    7272            end
    7373            when VRFileExists(srchRoot'\'SubDir'\'filestem||nlv'.'Suffix) then do
    74                 say "  Attempt2: NLV "Suffix" file found directly!"
     74                IF options.!debug == 1 then say "  Attempt2: NLV "Suffix" file found directly!"
    7575                NLVFile = strip(srchRoot'\'SubDir'\'filestem||nlv'.'Suffix,'L','\')
    7676                NLVSrchDone = 1
     
    7878            when SysSearchPath(PathVar, filestem||nlv'.'Suffix) \= '' then do
    7979                execDir = VRParseFileName(SysSearchPath(PathVar, filestem||nlv'.'Suffix),"DP")
    80                 say "  Attempt3: NLV "Suffix" file found via "PathVar
     80                IF options.!debug == 1 then say "  Attempt3: NLV "Suffix" file found via "PathVar
    8181                NLVFile = strip(execdir'\'filestem||nlv'.'Suffix,'L','\')
    8282                NLVSrchDone = 1
     
    8585                ok = SysFileTree(UnixRoot||'\usr\share\os2\'filestem||nlv'.'Suffix,nlvmsg.,'FOS')
    8686                if nlvmsg.0 = 1 then do
    87                     say "  Attempt4: Found  NLV "Suffix" file in rpm/yum subdirectory"
     87                    IF options.!debug == 1 then say "  Attempt4: Found  NLV "Suffix" file in rpm/yum subdirectory"
     88                    NLVFile = VRParseFilename(nlvmsg.1,"DPN")'.'Suffix
     89                    IF options.!debug == 1 then say "  Adding NLV "Suffix" path to "PathVar
     90                    OldPathVar = value(PathVar,,"OS2ENVIRONMENT")
     91                    ok = value(PathVar,VRParseFilename(nlvmsg.1,"DP")';'OldPathVar,"OS2ENVIRONMENT")
     92                    NLVSrchDone = 1
     93                end
     94                else IF options.!debug == 1 then say "  NLV "Suffix" file NOT in rpm/yum "UnixRoot||'\usr\share\os2\'filestem||nlv'.'Suffix"subdirectory."
     95            end
     96           
     97            otherwise do
     98                IF options.!debug == 1 then say "  Searching subdirectories"
     99                ok = SysFileTree(srchRoot'\'filestem||nlv'.'Suffix,nlvmsg.,'FOS')
     100                if nlvmsg.0 = 1 then do
     101                    IF options.!debug == 1 then say "  Found  NLV "Suffix" file in subdirectory"
    88102                    NLVFile = VRParseFilename(nlvmsg.1,"DPN")'.'Suffix
    89103                    say "  Adding NLV "Suffix" path to "PathVar
     
    92106                    NLVSrchDone = 1
    93107                end
    94                 else say "  NLV "Suffix" file NOT in rpm/yum "UnixRoot||'\usr\share\os2\'filestem||nlv'.'Suffix"subdirectory."
    95             end
    96            
    97             otherwise do
    98                 say "  Searching subdirectories"
    99                 ok = SysFileTree(srchRoot'\'filestem||nlv'.'Suffix,nlvmsg.,'FOS')
    100                 if nlvmsg.0 = 1 then do
    101                     say "  Found  NLV "Suffix" file in subdirectory"
    102                     NLVFile = VRParseFilename(nlvmsg.1,"DPN")'.'Suffix
    103                     say "  Adding NLV "Suffix" path to "PathVar
    104                     OldPathVar = value(PathVar,,"OS2ENVIRONMENT")
    105                     ok = value(PathVar,VRParseFilename(nlvmsg.1,"DP")';'OldPathVar,"OS2ENVIRONMENT")
    106                     NLVSrchDone = 1
    107                 end
    108                 else say "  NLV "Suffix" file not found in subdirectories!"
     108                else IF options.!debug == 1 then say "  NLV "Suffix" file not found in subdirectories!"
    109109            end
    110110        end
     
    116116            end
    117117            else do
    118                 say "  NLV "Suffix" File not found, falling back to EN."
     118                IF options.!debug == 1 then say "  NLV "Suffix" File not found, falling back to EN."
    119119                nlv = "EN"
    120120                /* Now we repeat the whole procedure to find the EN file */
     
    122122        end
    123123    end
    124     say time()' NLVSearch() done, returning "'NLVFile'"'
     124    IF options.!debug == 1 then say time()' NLVSearch() done, returning "'NLVFile'"'
    125125return NLVFile
    126126
Note: See TracChangeset for help on using the changeset viewer.