svn.jl 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. # This file is part of Reduce.jl. It is licensed under the MIT license
  2. # Copyright (C) 2017 Michael Reed
  3. ispsl() = haskey(ENV,"PSL")
  4. red() = ispsl() ? `redpsl` : `redcsl -w`
  5. red(path) = ispsl() ? `$path/redpsl` : `$path/redcsl -w`
  6. redsl() = ispsl() ? "psl" : "csl"
  7. ρ = 7
  8. date = Dict(
  9. 0 => "2017-05-16",
  10. 1 => "2018-01-17",
  11. 2 => "2018-04-06",
  12. 3 => "2019-04-13",
  13. 4 => "2019-09-15",
  14. 5 => "2020-03-01",
  15. 6 => "2020-06-24",
  16. 7 => "2020-10-07")
  17. rsvn = Dict(
  18. 0 => "4052",
  19. 1 => "4372",
  20. 2 => "4567",
  21. 3 => "4961",
  22. 4 => "5129",
  23. 5 => "5286",
  24. 6 => "5377",
  25. 7 => "5424")
  26. function redsys(dir)
  27. if !(Sys.iswindows())
  28. if Sys.islinux()
  29. red(joinpath(dir,"usr","bin"))
  30. elseif Sys.isapple()
  31. red(joinpath(dir,ispsl() ? "psl" : "csl"))
  32. else
  33. rsl = red(joinpath(dir,"Reduce-svn$(rsvn[ρ])-src","bin"))
  34. end
  35. else
  36. if ispsl()
  37. `"$(dir)\psl\bpsl.exe" -td 16000000 -f "$(dir)\red\reduce.img"`
  38. else
  39. `"$(dir)\reduce.exe" --nogui`
  40. end
  41. end
  42. end
  43. function _spawn(cmd, input=devnull, output=devnull)
  44. run(pipeline(cmd, stdin=input, stdout=output, stderr=stderr), wait=false)
  45. end