diff options
| author | dvs1 | 2024-11-04 15:24:59 +1000 |
|---|---|---|
| committer | dvs1 | 2024-11-04 15:24:59 +1000 |
| commit | fcfbbdc0de8e06c0b68156243afad8f88e75720b (patch) | |
| tree | 285a018d540679bb9ff316888ce91b626173ad87 | |
| parent | No need for os.exit() in these places. (diff) | |
| download | JackOnAllDevices-fcfbbdc0de8e06c0b68156243afad8f88e75720b.zip JackOnAllDevices-fcfbbdc0de8e06c0b68156243afad8f88e75720b.tar.gz JackOnAllDevices-fcfbbdc0de8e06c0b68156243afad8f88e75720b.tar.bz2 JackOnAllDevices-fcfbbdc0de8e06c0b68156243afad8f88e75720b.tar.xz | |
Refactor PolygLua.lua uninstall / purge.
Diffstat (limited to '')
| -rwxr-xr-x | PolygLua.lua | 39 |
1 files changed, 15 insertions, 24 deletions
diff --git a/PolygLua.lua b/PolygLua.lua index 7fad2d3..38e300c 100755 --- a/PolygLua.lua +++ b/PolygLua.lua | |||
| @@ -319,6 +319,19 @@ _.dir = __[[pwd]]:noErr():Do().lines[1] | |||
| 319 | 319 | ||
| 320 | 320 | ||
| 321 | if (arg[0] == './PolygLua.lua') or (arg[0] == 'PolygLua.lua') then | 321 | if (arg[0] == './PolygLua.lua') or (arg[0] == 'PolygLua.lua') then |
| 322 | local goAway(txt) | ||
| 323 | local luas = __'ls -d1 /usr/share/lua/*':noErr():Do() | ||
| 324 | for i,l in ipairs(luas.lines) do | ||
| 325 | local lua = '/usr/local/share/lua/' .. l:sub(16) .. '/PolygLua.lua' | ||
| 326 | if _.exists(lua) then | ||
| 327 | if 'root' == _.who then | ||
| 328 | print(txt .. ' ' .. lua) | ||
| 329 | __('rm ' .. lua):Do() | ||
| 330 | end | ||
| 331 | end | ||
| 332 | end | ||
| 333 | end | ||
| 334 | |||
| 322 | local options = | 335 | local options = |
| 323 | { | 336 | { |
| 324 | install = | 337 | install = |
| @@ -356,18 +369,7 @@ if (arg[0] == './PolygLua.lua') or (arg[0] == 'PolygLua.lua') then | |||
| 356 | E'Need to be root user to uninstall.' | 369 | E'Need to be root user to uninstall.' |
| 357 | else | 370 | else |
| 358 | print('UNINSTALLING PolygLua.lua!!!') | 371 | print('UNINSTALLING PolygLua.lua!!!') |
| 359 | 372 | goAway('Uninstalling') | |
| 360 | local luas = __'ls -d1 /usr/share/lua/*':noErr():Do() | ||
| 361 | for i,l in ipairs(luas.lines) do | ||
| 362 | local lua = '/usr/local/share/lua/' .. l:sub(16) .. '/PolygLua.lua' | ||
| 363 | if _.exists(lua) then | ||
| 364 | if 'root' == _.who then | ||
| 365 | print('Uninstalling ' .. lua) | ||
| 366 | __('rm ' .. lua):Do() | ||
| 367 | end | ||
| 368 | end | ||
| 369 | end | ||
| 370 | |||
| 371 | end | 373 | end |
| 372 | end | 374 | end |
| 373 | }, | 375 | }, |
| @@ -379,18 +381,7 @@ if (arg[0] == './PolygLua.lua') or (arg[0] == 'PolygLua.lua') then | |||
| 379 | E'Need to be root user to purge.' | 381 | E'Need to be root user to purge.' |
| 380 | else | 382 | else |
| 381 | print('PURGING PolygLua.lua!!!') | 383 | print('PURGING PolygLua.lua!!!') |
| 382 | 384 | goAway('Purging') | |
| 383 | local luas = __'ls -d1 /usr/share/lua/*':noErr():Do() | ||
| 384 | for i,l in ipairs(luas.lines) do | ||
| 385 | local lua = '/usr/local/share/lua/' .. l:sub(16) .. '/PolygLua.lua' | ||
| 386 | if _.exists(lua) then | ||
| 387 | if 'root' == _.who then | ||
| 388 | print('Purging ' .. lua) | ||
| 389 | __('rm ' .. lua):Do() | ||
| 390 | end | ||
| 391 | end | ||
| 392 | end | ||
| 393 | |||
| 394 | end | 385 | end |
| 395 | end | 386 | end |
| 396 | }, | 387 | }, |
