From 23965204136603e49f401fccb1b6e16962529791 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Mon, 22 Jun 2009 10:23:21 +0000 Subject: [PATCH] luci-0.9: merge r4886-r4890 --- build/setup.lua | 2 + 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 ++++++------------ .../httpclient/luasrc/httpclient/receiver.lua | 9 +- libs/nixio/lua/nixio/fs.lua | 40 +++--- libs/nixio/src/fs.c | 2 +- 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 +- .../freifunk/root/usr/sbin/ff_olsr_watchdog | 6 +- .../view/themes/freifunk-hannover/header.htm | 2 +- .../view/themes/openwrt-light/header.htm | 2 +- .../view/themes/openwrt.org-oxygen/header.htm | 2 +- .../luasrc/view/themes/openwrt.org/header.htm | 2 +- 26 files changed, 153 insertions(+), 296 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/build/setup.lua b/build/setup.lua index dbe9bdcc9a..a3e64f3d19 100644 --- a/build/setup.lua +++ b/build/setup.lua @@ -9,3 +9,5 @@ x(self, schemedir or SYSROOT .. "/lib/uci/schema") end + local sys = require "luci.sys" + sys.user.checkpasswd = function() return true end diff --git a/contrib/bitlib/.gitignore b/contrib/bitlib/.gitignore deleted file mode 100644 index 7211268c81..0000000000 --- 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 ea08c973bb..0000000000 --- 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 a94e1983fe..e77fb74417 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 f55ea72042..17a305889d 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 3a48e74189..acaaac8281 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 1407d23872..0000000000 --- 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 70d3c9c4c0..0000000000 --- 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 0263f6174b..46f356eb59 100644 --- a/contrib/package/luci/Makefile +++ b/contrib/package/luci/Makefile @@ -94,7 +94,7 @@ endef define Package/luci-core $(call Package/luci/libtemplate) - DEPENDS:=+lua + DEPENDS:=+lua +luci-nixio TITLE:=LuCI core libraries endef @@ -242,7 +242,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 0e223a933f..5eda993b67 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$