Ignore:
Timestamp:
May 28, 2019, 2:29:12 PM (6 years ago)
Author:
herwigb
Message:

spec: os2-rpm: Release version 1-7.

Location:
spec/trunk/SPECS/os2-rpm
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • spec/trunk/SPECS/os2-rpm/warpin-conflicts.cmd

    r1299 r1644  
    1212 *
    1313 * Author: Dmitriy Kuminov
     14 * Version: 1.4 - 2019-05-27 (Silvan Scherrer)
     15 *   - Check for dummy WarpIN entries from wpi4rpm
    1416 * Version: 1.3 - 2018-02-19 (Herwig Bauernfeind)
    1517 *   - Shorten and apply common style to error messages to make the readable
     
    4850parse arg G.Args
    4951
     52G.WarpInDir = strip(SysIni('USER', 'WarpIN', 'Path'), 'T', '0'x)
     53rc = SysFileTree(G.WarpInDir'\DATBAS_?.INI', 'G.inis', 'FO')
     54if (rc \== 0) then do
     55     G.inis = 0
     56end
     57
    5058return Main()
    5159
     
    6775        if (ver \== '') then do
    6876            say ver
     77            rpmdummy = GetRpmVersion(G.Args, ver)
     78            if (rpmdummy == 'Y') then exit 0
    6979            exit 1
    7080        end
     
    91101    if (ver == '') then exit 0
    92102
     103    rpmdummy = GetRpmVersion(packages.i, ver)
     104    if (rpmdummy == 'Y') then exit 0
     105
    93106    say 'ERROR: warpin-conflicts: Please, uninstall WarpIN 'packages.i' (Version 'ver')'
    94107    exit 1
     
    101114 * @return          Package version or ''.
    102115 */
    103 GetPkgVersion: procedure
     116GetPkgVersion: procedure expose(Globals)
    104117    parse arg aPkgId
    105118    parse var aPkgId v1'\'a1'\'p1
    106119    if (v1 == '' | a1 == '' | p1 == '') then return ''
    107120    ver = ''
    108     WarpInDir = strip(SysIni('USER', 'WarpIN', 'Path'), 'T', '0'x)
    109     if (WarpInDir \== '') then do
     121    if (G.WarpInDir \== '') then do
    110122        /* first, check if we have WIC that supports -p (1.0.16+) */
    111123        wic_ver = ''
    112         wic_exe = stream(WarpInDir'\WIC.EXE', 'C', 'QUERY EXISTS')
     124        wic_exe = stream(G.WarpInDir'\WIC.EXE', 'C', 'QUERY EXISTS')
    113125        if (wic_exe \== '') then do
    114126            temp_dir = value('TMP',, 'OS2ENVIRONMENT')
    115127            if (temp_dir = '') then temp_dir = value('TEMP',, 'OS2ENVIRONMENT')
    116128            temp_file = SysTempFileName(temp_dir'\wic?????.tmp')
    117             call SysSetExtLibPath WarpInDir';%BEGINLIBPATH%', 'B'
     129            call SysSetExtLibPath G.WarpInDir';%BEGINLIBPATH%', 'B'
    118130            address 'cmd' wic_exe '-h 2>nul 1>'temp_file
    119131            if (rc == 0) then do
     
    144156        end
    145157        /* sad, but we failed with WIC and have to use the old unsatable method... */
    146         rc = SysFileTree(WarpInDir'\DATBAS_?.INI', 'inis', 'FO')
    147         if (rc == 0) then do
    148             do i = 1 to inis.0
    149                 rc = SysIni(inis.i, 'ALL:', 'apps')
     158        if (G.inis \== 0) then do
     159            do i = 1 to G.inis.0
     160                rc = SysIni(G.inis.i, 'ALL:', 'apps')
    150161                if (rc == '') then do
    151162                    do j = 1 to apps.0
     
    160171                end
    161172                else do
    162                     say 'ERROR: warpin-conflicts: Failed to access the WarpIn database file 'inis.i
     173                    say 'ERROR: warpin-conflicts: Failed to access the WarpIn database file 'G.inis.i
    163174                    exit 5
    164175                end
     
    167178    end
    168179    return ''
     180
     181GetRpmVersion: procedure expose(Globals)
     182    parse arg aPkgId, aPkgVer
     183
     184    app = strip(translate(aPkgId, '', '"')) || '\' || translate(aPkgVer, '\', '.')
     185    files = ''
     186    if (G.WarpInDir \== '') then do
     187        if (G.inis \== 0) then do
     188            do i = 1 to G.inis.0
     189                files = SysIni(G.inis.i, app, 'Files')
     190                if (files \== '') then leave
     191            end
     192        end
     193    end
     194    if (files == 'rpmdummy') then do
     195       return 'Y'
     196    end
     197    else do
     198       return 'N'
     199    end
  • spec/trunk/SPECS/os2-rpm/wpi4rpm.cmd

    r1460 r1644  
    11/* WPI4RPM */
    22
    3 ScriptVer = '0.9.9.1'
     3ScriptVer = '1.0.0.0'
    44
    55/*  Synopsis:
     
    5151Mode = translate(mode)
    5252
    53 if Mode = "ADD" | Mode = "DEL" then do
     53if Mode = "ADD" | Mode = "DEL" | Mode = "CHK" then do
    5454    if verbose then say 'INFO:  wpi4rpm: Mode = "'Mode'"'
     55    if words(arguments) = 2 then arguments = arguments' 99.99.99-99'
    5556    cversion  = word(arguments,words(arguments))
    5657    pRApp     = substr(arguments,length(mode)+2,length(arguments)-(length(mode)+1)-(length(cversion)+1))
     
    6768   
    6869    if pos('/',pRApp) = 0 then do
    69         RApp = pRApp
     70        RApp = strip(pRApp)
    7071        RVendor   = "wpi4rpm" /* We do not add the true vendor on purpose */
    7172        RPackage  = "wpi4rpm" /* We do not add the true packages on purpose */
     
    8384end
    8485else do
    85     say 'WPI4RPM Version 'ScriptVer' (c) 2017-2018 Herwig Bauernfeind for bww bitwise works GmbH.'
     86    say 'WPI4RPM Version 'ScriptVer' (c) 2017-2019 Herwig Bauernfeind for bww bitwise works GmbH.'
    8687    say
    87     say '  Adds or removes dummy WPI packages to WarpIN database.'
     88    say '  Adds dummy, removes or checks for WPI packages in WarpIN database.'
    8889    say
    8990    say '  wpi4rpm ADD "Vendor/App/Package" x.x.x-x'
    9091    say '  wpi4rpm DEL "Vendor/App/Package" x.x.x-x'
     92    say '  wpi4rpm CHK "Vendor/App/Package" [x.x.x-x]'
    9193    say '  wpi4rpm HELP | /? | /H | /HELP | -H | --HELP'
    9294    say
     
    170172        end
    171173    end
     174    when mode = "CHK" then do
     175        if verbose then say 'INFO:  wpi4rpm: "'Datbas'" will be used.'
     176        AppFound = 0
     177        do I = 1 to WarpINApps.0
     178            parse var WarpINApps.I WVendor '\' WApp '\' WPackage '\' WMV '\' WLV '\' WBL '\' WRV
     179            if pos(WApp'\', AppString) > 0 then do
     180                if RMV'\'RLV'\'RBL'\'RRV = '99\99\99\99' then Appfound = 1
     181                else if pos(WMV'\'WLV'\'WBL'\'WRV, AppString) > 0 then Appfound = 1
     182                if verbose then say 'INFO:  wpi4rpm: "'WarpINApps.I'" found.'
     183            end
     184            if Appfound = 1 then leave
     185                end
     186                exit AppFound
     187    end
    172188    otherwise do
    173189        say "ERROR: wpi4rpm: Unknown command invoked. Run wpi4rpm help to learn about usage."
Note: See TracChangeset for help on using the changeset viewer.