OpenSDE Packages Database (without history before r20070)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

74 lines
2.4 KiB

  1. # --- SDE-COPYRIGHT-NOTE-BEGIN ---
  2. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  3. #
  4. # Filename: package/.../lua-posix/update-lua51.patch
  5. # Copyright (C) 2004 - 2006 The T2 SDE Project
  6. #
  7. # More information can be found in the files COPYING and README.
  8. #
  9. # This patch file is dual-licensed. It is available under the license the
  10. # patched project is licensed under, as long as it is an OpenSource license
  11. # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
  12. # of the GNU General Public License as published by the Free Software
  13. # Foundation; either version 2 of the License, or (at your option) any later
  14. # version.
  15. # --- SDE-COPYRIGHT-NOTE-END ---
  16. --- posix/lposix.c 2003-11-06 01:23:48.000000000 +0100
  17. +++ posix-5.1-alpha/lposix.c 2005-09-04 13:59:15.000000000 +0200
  18. @@ -64,7 +64,7 @@
  19. }
  20. else
  21. {
  22. - int j=luaL_findstring(luaL_checkstring(L, i), S);
  23. + int j=luaL_checkoption(L, i, NULL, S);
  24. if (j==-1) luaL_argerror(L, i, "unknown selector");
  25. return F(L, j, data);
  26. }
  27. @@ -802,7 +802,7 @@
  28. {NULL, NULL}
  29. };
  30. -LUALIB_API int luaopen_posix (lua_State *L)
  31. +LUALIB_API int luaopen_lposix (lua_State *L)
  32. {
  33. luaL_openlib(L, MYNAME, R, 0);
  34. lua_pushliteral(L,"version"); /** version */
  35. --- posix/posix.lua 2003-06-18 14:47:44.000000000 +0200
  36. +++ posix-5.1-alpha/posix.lua 2005-09-04 14:15:14.000000000 +0200
  37. @@ -1,10 +1,4 @@
  38. -- posix.lua
  39. -- support code for posix library
  40. --- usage lua -lposix ...
  41. -local function so(x)
  42. - local SOPATH= os.getenv"LUA_SOPATH" or "./"
  43. - assert(loadlib(SOPATH.."l"..x..".so","luaopen_"..x))()
  44. -end
  45. -
  46. -so"posix"
  47. +require"lposix"
  48. --- posix/test.lua 2003-11-07 12:42:30.000000000 +0100
  49. +++ posix-5.1-alpha/test.lua 2005-09-04 13:51:39.000000000 +0200
  50. @@ -41,7 +41,7 @@
  51. f"HOME"
  52. f"SHELL"
  53. f"absent"
  54. -for k in ox.getenv() do io.write(k,"\t") end io.write"\n"
  55. +for k,_ in pairs(ox.getenv()) do io.write(k,"\t") end io.write"\n"
  56. ------------------------------------------------------------------------------
  57. testing"putenv"
  58. @@ -179,11 +179,11 @@
  59. ------------------------------------------------------------------------------
  60. testing"times"
  61. a=ox.times()
  62. -for k,v in a do print(k,v) end
  63. +for k,v in pairs(a) do print(k,v) end
  64. print"sleeping 10 seconds..."
  65. ox.sleep(10)
  66. b=ox.times()
  67. -for k,v in b do print(k,v) end
  68. +for k,v in pairs(b) do print(k,v) end
  69. print""
  70. print("elapsed",b.elapsed-a.elapsed)
  71. print("clock",os.clock())