From 30b216f774c2404a965807ddb93a4a4b2aaeac04 Mon Sep 17 00:00:00 2001 From: Steven Barth Date: Sun, 21 Jun 2009 13:42:26 +0000 Subject: [PATCH] Drop support for luaposix and bitlib (obsoleted by nixio) Mark luci.fs as deprecated --- contrib/bitlib/.gitignore | 1 - contrib/bitlib/Makefile | 36 ------- contrib/luadoc/lua/luadoc/doclet/html.lua | 2 +- contrib/luadoc/lua/luadoc/taglet/standard.lua | 12 +-- contrib/luadoc/lua/luadoc/util.lua | 2 +- contrib/luaposix/.gitignore | 3 - contrib/luaposix/Makefile | 35 ------- contrib/package/luci/Makefile | 4 +- libs/cbi/luasrc/view/cbi/filebrowser.htm | 8 +- libs/cbi/luasrc/view/cbi/upload.htm | 2 +- libs/core/luasrc/ccache.lua | 15 +-- libs/core/luasrc/fs.lua | 128 ++++++++---------------- libs/httpclient/luasrc/httpclient/receiver.lua | 9 +- libs/sys/luasrc/sys.lua | 85 +++++----------- libs/uvl/luasrc/uvl/datatypes.lua | 12 +-- libs/web/luasrc/dispatcher.lua | 11 +- libs/web/luasrc/sauth.lua | 16 +-- libs/web/luasrc/template.lua | 10 +- modules/freifunk/root/usr/sbin/ff_olsr_watchdog | 6 +- 19 files changed, 126 insertions(+), 271 deletions(-) delete mode 100644 contrib/bitlib/.gitignore delete mode 100644 contrib/bitlib/Makefile delete mode 100644 contrib/luaposix/.gitignore delete mode 100644 contrib/luaposix/Makefile diff --git a/contrib/bitlib/.gitignore b/contrib/bitlib/.gitignore deleted file mode 100644 index 7211268c8..000000000 --- a/contrib/bitlib/.gitignore +++ /dev/null @@ -1 +0,0 @@ -bitlib-* diff --git a/contrib/bitlib/Makefile b/contrib/bitlib/Makefile deleted file mode 100644 index ea08c973b..000000000 --- a/contrib/bitlib/Makefile +++ /dev/null @@ -1,36 +0,0 @@ -include ../../build/config.mk -include ../../build/gccconfig.mk - -BITLIB_VERSION = 25 -BITLIB_SITE = http://dev.luci.freifunk-halle.net/sources/ -BITLIB_DIR = bitlib-$(BITLIB_VERSION) -BITLIB_FILE = $(BITLIB_DIR).tar.gz -BITLIB_URL = $(BITLIB_SITE)/$(BITLIB_FILE) - -all: compile - -include ../../build/module.mk - -$(BITLIB_FILE): - wget -O $@ $(BITLIB_URL) || rm -f $@ - -$(BITLIB_DIR)/.prepared: $(BITLIB_FILE) - rm -rf $(BITLIB_DIR) - tar xvfz $(BITLIB_FILE) - test -f $(BITLIB_DIR)/config.h || cp $(BITLIB_DIR)/config.h.in $(BITLIB_DIR)/config.h - touch $@ - -compile: $(BITLIB_DIR)/.prepared dist$(LUA_LIBRARYDIR)/bit.so - -dist$(LUA_LIBRARYDIR)/bit.so: - mkdir -p dist$(LUA_LIBRARYDIR) - $(COMPILE) -DHAVE_CONFIG_H -I$(BITLIB_DIR) -O2 -c $(BITLIB_DIR)/lbitlib.c $(FPIC) $(LUA_CFLAGS) -o $(BITLIB_DIR)/lbitlib.o - $(LINK) $(SHLIB_FLAGS) $(LDFLAGS) $(BITLIB_DIR)/lbitlib.o $(LUA_SHLIBS) -lm -ldl -o dist$(LUA_LIBRARYDIR)/bit.so - -luasource: -luastrip: -luacompile: -compile-all: compile - -clean: - rm -rf $(BITLIB_DIR) $(BITLIB_FILE) diff --git a/contrib/luadoc/lua/luadoc/doclet/html.lua b/contrib/luadoc/lua/luadoc/doclet/html.lua index a94e1983f..e77fb7441 100644 --- a/contrib/luadoc/lua/luadoc/doclet/html.lua +++ b/contrib/luadoc/lua/luadoc/doclet/html.lua @@ -14,7 +14,7 @@ local assert, getfenv, ipairs, loadstring, pairs, setfenv, tostring, tonumber, type = assert, getfenv, ipairs, loadstring, pairs, setfenv, tostring, tonumber, type local io = require"io" -local posix = require "posix" +local posix = require "nixio.fs" local lp = require "luadoc.lp" local luadoc = require"luadoc" local package = package diff --git a/contrib/luadoc/lua/luadoc/taglet/standard.lua b/contrib/luadoc/lua/luadoc/taglet/standard.lua index f55ea7204..17a305889 100644 --- a/contrib/luadoc/lua/luadoc/taglet/standard.lua +++ b/contrib/luadoc/lua/luadoc/taglet/standard.lua @@ -4,7 +4,7 @@ local assert, pairs, tostring, type = assert, pairs, tostring, type local io = require "io" -local posix = require "posix" +local posix = require "nixio.fs" local luadoc = require "luadoc" local util = require "luadoc.util" local tags = require "luadoc.taglet.standard.tags" @@ -505,14 +505,14 @@ end -- @return table with documentation function directory (path, doc) - for f in posix.files(path) do + for f in posix.dir(path) do local fullpath = path .. "/" .. f local attr = posix.stat(fullpath) assert(attr, string.format("error stating file `%s'", fullpath)) - if attr.type == "regular" then + if attr.type == "reg" then doc = file(fullpath, doc) - elseif attr.type == "directory" and f ~= "." and f ~= ".." then + elseif attr.type == "dir" and f ~= "." and f ~= ".." then doc = directory(fullpath, doc) end end @@ -550,9 +550,9 @@ function start (files, doc) local attr = posix.stat(path) assert(attr, string.format("error stating path `%s'", path)) - if attr.type == "regular" then + if attr.type == "reg" then doc = file(path, doc) - elseif attr.type == "directory" then + elseif attr.type == "dir" then doc = directory(path, doc) end end) diff --git a/contrib/luadoc/lua/luadoc/util.lua b/contrib/luadoc/lua/luadoc/util.lua index 3a48e7418..acaaac828 100644 --- a/contrib/luadoc/lua/luadoc/util.lua +++ b/contrib/luadoc/lua/luadoc/util.lua @@ -3,7 +3,7 @@ -- @release $Id: util.lua,v 1.16 2008/02/17 06:42:51 jasonsantos Exp $ ------------------------------------------------------------------------------- -local posix = require "posix" +local posix = require "nixio.fs" local type, table, string, io, assert, tostring, setmetatable, pcall = type, table, string, io, assert, tostring, setmetatable, pcall ------------------------------------------------------------------------------- diff --git a/contrib/luaposix/.gitignore b/contrib/luaposix/.gitignore deleted file mode 100644 index 1407d2387..000000000 --- a/contrib/luaposix/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -luaposix-* -lua-posix_* -patches/series diff --git a/contrib/luaposix/Makefile b/contrib/luaposix/Makefile deleted file mode 100644 index 70d3c9c4c..000000000 --- a/contrib/luaposix/Makefile +++ /dev/null @@ -1,35 +0,0 @@ -include ../../build/config.mk -include ../../build/gccconfig.mk - -LUAPOSIX_VERSION = 5.1.4 -LUAPOSIX_SITE = http://dev.luci.freifunk-halle.net/sources/ -LUAPOSIX_DIR = luaposix-$(LUAPOSIX_VERSION) -LUAPOSIX_FILE = lua-posix_5.1.4.orig.tar.gz -LUAPOSIX_URL = $(LUAPOSIX_SITE)/$(LUAPOSIX_FILE) -LUAPOSIX_PATCHDIR = patches - -all: compile - -include ../../build/module.mk - -$(LUAPOSIX_FILE): - wget -O $@ $(LUAPOSIX_URL) || rm -f $@ - -$(LUAPOSIX_DIR)/.prepared: $(LUAPOSIX_FILE) - rm -rf $(LUAPOSIX_DIR) - tar xvfz $(LUAPOSIX_FILE) - touch $@ - -compile: $(LUAPOSIX_DIR)/.prepared - $(MAKE) -C $(LUAPOSIX_DIR) CC=$(CC) CFLAGS="$(CFLAGS) $(LUA_CFLAGS)" LDFLAGS="$(LDFLAGS) $(LUA_SHLIBS)" OS="$(OS)" - mkdir -p dist$(LUA_LIBRARYDIR) - cp $(LUAPOSIX_DIR)/posix.so dist$(LUA_LIBRARYDIR) - -luasource: -luastrip: -luacompile: -compile-all: compile - -clean: - rm -rf $(LUAPOSIX_DIR) $(LUAPOSIX_FILE) - rm -f $(LUAPOSIX_PATCHDIR)/series diff --git a/contrib/package/luci/Makefile b/contrib/package/luci/Makefile index 826fc193b..4680d6576 100644 --- a/contrib/package/luci/Makefile +++ b/contrib/package/luci/Makefile @@ -98,7 +98,7 @@ endef define Package/luci-core $(call Package/luci/libtemplate) - DEPENDS:=+lua + DEPENDS:=+lua +luci-nixio TITLE:=LuCI core libraries endef @@ -246,7 +246,7 @@ NIXIO_TLS:=axtls define Package/luci-nixio $(call Package/luci/libtemplate) - TITLE:=NIXIO Socket Library + TITLE:=NIXIO POSIX Library DEPENDS:= endef diff --git a/libs/cbi/luasrc/view/cbi/filebrowser.htm b/libs/cbi/luasrc/view/cbi/filebrowser.htm index 0e223a933..5eda993b6 100644 --- a/libs/cbi/luasrc/view/cbi/filebrowser.htm +++ b/libs/cbi/luasrc/view/cbi/filebrowser.htm @@ -66,10 +66,10 @@ $Id$ local filestat = luci.fs.stat( filepath ) local baseurl = luci.dispatcher.build_url('admin', 'filebrowser') - if filestat and filestat.type == "regular" then + if filestat and filestat.type == "reg" then table.remove( path, #path ) filepath = table.concat( path, '/' ) .. '/' - elseif not ( filestat and filestat.type == "directory" ) then + elseif not ( filestat and filestat.type == "dir" ) then path = { '' } filepath = '/' else @@ -99,7 +99,7 @@ $Id$