Changeset 1644 for spec/trunk/SPECS/os2-rpm
- Timestamp:
- May 28, 2019, 2:29:12 PM (6 years ago)
- Location:
- spec/trunk/SPECS/os2-rpm
- Files:
-
- 2 edited
-
warpin-conflicts.cmd (modified) (8 diffs)
-
wpi4rpm.cmd (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
spec/trunk/SPECS/os2-rpm/warpin-conflicts.cmd
r1299 r1644 12 12 * 13 13 * Author: Dmitriy Kuminov 14 * Version: 1.4 - 2019-05-27 (Silvan Scherrer) 15 * - Check for dummy WarpIN entries from wpi4rpm 14 16 * Version: 1.3 - 2018-02-19 (Herwig Bauernfeind) 15 17 * - Shorten and apply common style to error messages to make the readable … … 48 50 parse arg G.Args 49 51 52 G.WarpInDir = strip(SysIni('USER', 'WarpIN', 'Path'), 'T', '0'x) 53 rc = SysFileTree(G.WarpInDir'\DATBAS_?.INI', 'G.inis', 'FO') 54 if (rc \== 0) then do 55 G.inis = 0 56 end 57 50 58 return Main() 51 59 … … 67 75 if (ver \== '') then do 68 76 say ver 77 rpmdummy = GetRpmVersion(G.Args, ver) 78 if (rpmdummy == 'Y') then exit 0 69 79 exit 1 70 80 end … … 91 101 if (ver == '') then exit 0 92 102 103 rpmdummy = GetRpmVersion(packages.i, ver) 104 if (rpmdummy == 'Y') then exit 0 105 93 106 say 'ERROR: warpin-conflicts: Please, uninstall WarpIN 'packages.i' (Version 'ver')' 94 107 exit 1 … … 101 114 * @return Package version or ''. 102 115 */ 103 GetPkgVersion: procedure 116 GetPkgVersion: procedure expose(Globals) 104 117 parse arg aPkgId 105 118 parse var aPkgId v1'\'a1'\'p1 106 119 if (v1 == '' | a1 == '' | p1 == '') then return '' 107 120 ver = '' 108 WarpInDir = strip(SysIni('USER', 'WarpIN', 'Path'), 'T', '0'x) 109 if (WarpInDir \== '') then do 121 if (G.WarpInDir \== '') then do 110 122 /* first, check if we have WIC that supports -p (1.0.16+) */ 111 123 wic_ver = '' 112 wic_exe = stream( WarpInDir'\WIC.EXE', 'C', 'QUERY EXISTS')124 wic_exe = stream(G.WarpInDir'\WIC.EXE', 'C', 'QUERY EXISTS') 113 125 if (wic_exe \== '') then do 114 126 temp_dir = value('TMP',, 'OS2ENVIRONMENT') 115 127 if (temp_dir = '') then temp_dir = value('TEMP',, 'OS2ENVIRONMENT') 116 128 temp_file = SysTempFileName(temp_dir'\wic?????.tmp') 117 call SysSetExtLibPath WarpInDir';%BEGINLIBPATH%', 'B'129 call SysSetExtLibPath G.WarpInDir';%BEGINLIBPATH%', 'B' 118 130 address 'cmd' wic_exe '-h 2>nul 1>'temp_file 119 131 if (rc == 0) then do … … 144 156 end 145 157 /* 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') 150 161 if (rc == '') then do 151 162 do j = 1 to apps.0 … … 160 171 end 161 172 else do 162 say 'ERROR: warpin-conflicts: Failed to access the WarpIn database file ' inis.i173 say 'ERROR: warpin-conflicts: Failed to access the WarpIn database file 'G.inis.i 163 174 exit 5 164 175 end … … 167 178 end 168 179 return '' 180 181 GetRpmVersion: 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 1 1 /* WPI4RPM */ 2 2 3 ScriptVer = ' 0.9.9.1'3 ScriptVer = '1.0.0.0' 4 4 5 5 /* Synopsis: … … 51 51 Mode = translate(mode) 52 52 53 if Mode = "ADD" | Mode = "DEL" then do53 if Mode = "ADD" | Mode = "DEL" | Mode = "CHK" then do 54 54 if verbose then say 'INFO: wpi4rpm: Mode = "'Mode'"' 55 if words(arguments) = 2 then arguments = arguments' 99.99.99-99' 55 56 cversion = word(arguments,words(arguments)) 56 57 pRApp = substr(arguments,length(mode)+2,length(arguments)-(length(mode)+1)-(length(cversion)+1)) … … 67 68 68 69 if pos('/',pRApp) = 0 then do 69 RApp = pRApp70 RApp = strip(pRApp) 70 71 RVendor = "wpi4rpm" /* We do not add the true vendor on purpose */ 71 72 RPackage = "wpi4rpm" /* We do not add the true packages on purpose */ … … 83 84 end 84 85 else do 85 say 'WPI4RPM Version 'ScriptVer' (c) 2017-201 8Herwig Bauernfeind for bww bitwise works GmbH.'86 say 'WPI4RPM Version 'ScriptVer' (c) 2017-2019 Herwig Bauernfeind for bww bitwise works GmbH.' 86 87 say 87 say ' Adds or removes dummy WPI packages toWarpIN database.'88 say ' Adds dummy, removes or checks for WPI packages in WarpIN database.' 88 89 say 89 90 say ' wpi4rpm ADD "Vendor/App/Package" x.x.x-x' 90 91 say ' wpi4rpm DEL "Vendor/App/Package" x.x.x-x' 92 say ' wpi4rpm CHK "Vendor/App/Package" [x.x.x-x]' 91 93 say ' wpi4rpm HELP | /? | /H | /HELP | -H | --HELP' 92 94 say … … 170 172 end 171 173 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 172 188 otherwise do 173 189 say "ERROR: wpi4rpm: Unknown command invoked. Run wpi4rpm help to learn about usage."
Note:
See TracChangeset
for help on using the changeset viewer.
