* Minor bugfixes
authorSteven Barth <steven@midlink.org>
Thu, 8 May 2008 20:52:20 +0000 (20:52 +0000)
committerSteven Barth <steven@midlink.org>
Thu, 8 May 2008 20:52:20 +0000 (20:52 +0000)
applications/community-leipzig/root/etc/uci-defaults/ffluci-community-leipzig
contrib/package/ffluci/Makefile
contrib/package/ffluci/ipkg/ffluci-community-leipzig.postinst [deleted file]
contrib/package/ffluci/ipkg/ffluci-ff-leipzig.postinst [new file with mode: 0755]
core/src/fs.lua
core/src/menu.lua

index e73ff91..3ba84d0 100644 (file)
@@ -11,5 +11,6 @@ uci batch <<-EOF
         set freifunk.community.dhcp=10.0.0.0
         set freifunk.community.dhcpmask=255.255.255.0
         set freifunk.community.dns='88.198.178.18 141.54.1.1 212.204.49.83 208.67.220.220 208.67.222.222'
+        commit freifunk
 EOF
        
\ No newline at end of file
index 2e65377..8b51e97 100644 (file)
@@ -41,12 +41,7 @@ define Package/ffluci/template
 endef
 
 define Package/ffluci/install/template
-  $(CP) $(PKG_BUILD_DIR)/$(2)/dist/* $(1)/ -R
-  
-  for i in $(PKG_BUILD_DIR)/$(2)/dist/usr/bin/*; do $(INSTALL_BIN) $$i $(1)/usr/bin/; done
-  for i in $(PKG_BUILD_DIR)/$(2)/dist/usr/sbin/*; do $(INSTALL_BIN) $$i $(1)/usr/sbin/; done
-  for i in $(PKG_BUILD_DIR)/$(2)/dist/bin/*; do $(INSTALL_BIN) $$i $(1)/bin/; done
-  for i in $(PKG_BUILD_DIR)/$(2)/dist/sbin/*; do $(INSTALL_BIN) $$i $(1)/sbin/; done
+       $(CP) $(PKG_BUILD_DIR)/$(2)/dist/* $(1)/ -R
 endef
 
 
@@ -61,8 +56,8 @@ define Package/ffluci/conffiles
 endef
 
 define Package/ffluci/install          
-  $(call Package/ffluci/install/template,$(1),core)
-  $(call Package/ffluci/install/template,$(1),themes/fledermaus)
+       $(call Package/ffluci/install/template,$(1),core)
+       $(call Package/ffluci/install/template,$(1),themes/fledermaus)
 endef
 
 
@@ -91,7 +86,8 @@ define Package/ffluci-ff-leipzig
 endef
 
 define Package/ffluci-ff-leipzig/install
-  $(call Package/ffluci/install/template,$(1),applications/community-leipzig)
+       $(call Package/ffluci/install/template,$(1),applications/community-leipzig)
+       $(CP) -a ./ipkg/ffluci-ff-leipzig.postinst $(1)/CONTROL/postinst
 endef
 
 
@@ -105,7 +101,7 @@ define Package/ffluci-mod-admin-core
 endef
 
 define Package/ffluci-mod-admin-core/install
-  $(call Package/ffluci/install/template,$(1),modules/admin-core)
+       $(call Package/ffluci/install/template,$(1),modules/admin-core)
 endef
 
 
@@ -120,7 +116,8 @@ define Package/ffluci-mod-freifunk/conffiles
 endef
 
 define Package/ffluci-mod-freifunk/install
-  $(call Package/ffluci/install/template,$(1),modules/freifunk)
+       $(call Package/ffluci/install/template,$(1),modules/freifunk)
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/modules/freifunk/dist/etc/init.d/luci_freifunk $(1)/etc/init.d
 endef
 
 
@@ -138,7 +135,8 @@ define Package/ffluci-app-firewall/conffiles
 endef
 
 define Package/ffluci-app-firewall/install
-  $(call Package/ffluci/install/template,$(1),applications/luci-fw)
+       $(call Package/ffluci/install/template,$(1),applications/luci-fw)
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/applications/luci-fw/dist/etc/init.d/luci_fw $(1)/etc/init.d
 endef
 
 
@@ -153,7 +151,9 @@ define Package/ffluci-app-splash/conffiles
 endef
 
 define Package/ffluci-app-splash/install
-  $(call Package/ffluci/install/template,$(1),applications/luci-splash)
+       $(call Package/ffluci/install/template,$(1),applications/luci-splash)
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/applications/luci-splash/dist/usr/sbin/luci-splash $(1)/usr/sbin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/applications/luci-splash/dist/etc/init.d/luci_splash $(1)/etc/init.d
 endef
 
 
@@ -167,7 +167,8 @@ define Package/ffluci-sgi-haserl
 endef
 
 define Package/ffluci-sgi-haserl/install
-  $(call Package/ffluci/install/template,$(1),applications/sgi-haserl)
+       $(call Package/ffluci/install/template,$(1),applications/sgi-haserl)
+       $(CP) -a ./ipkg/ffluci-sgi-haserl.postinst $(1)/CONTROL/postinst
 endef
 
 
@@ -178,7 +179,7 @@ define Package/ffluci-sgi-webuci
 endef
 
 define Package/ffluci-sgi-webuci/install
-  $(call Package/ffluci/install/template,$(1),applications/sgi-webuci)
+       $(call Package/ffluci/install/template,$(1),applications/sgi-webuci)
 endef
 
 
@@ -186,7 +187,6 @@ endef
 
 $(eval $(call BuildPackage,ffluci))
 
-
 $(eval $(call BuildPackage,ffluci-ff-halle))
 $(eval $(call BuildPackage,ffluci-ff-leipzig))
 
diff --git a/contrib/package/ffluci/ipkg/ffluci-community-leipzig.postinst b/contrib/package/ffluci/ipkg/ffluci-community-leipzig.postinst
deleted file mode 100755 (executable)
index 26eace9..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-[ -n "${IPKG_INSTROOT}" ] || {
-       ( . /etc/uci-defaults/ffluci-community-leipzig ) &&     rm -f /etc/uci-defaults/ffluci-community-leipzig
-}
diff --git a/contrib/package/ffluci/ipkg/ffluci-ff-leipzig.postinst b/contrib/package/ffluci/ipkg/ffluci-ff-leipzig.postinst
new file mode 100755 (executable)
index 0000000..26eace9
--- /dev/null
@@ -0,0 +1,4 @@
+#!/bin/sh
+[ -n "${IPKG_INSTROOT}" ] || {
+       ( . /etc/uci-defaults/ffluci-community-leipzig ) &&     rm -f /etc/uci-defaults/ffluci-community-leipzig
+}
index 0ca191b..4639ac4 100644 (file)
@@ -29,9 +29,7 @@ module("ffluci.fs", package.seeall)
 require("posix")
 
 -- Glob
-function glob(pattern)
-       return posix.glob(pattern)
-end
+glob = posix.glob
 
 -- Checks whether a file exists
 function isfile(filename)
@@ -79,13 +77,7 @@ basename = posix.basename
 dirname = posix.dirname
 
 -- dir wrapper
-function dir(path)
-       local dir = {}
-       for node in posix.files(path) do
-               table.insert(dir, 1, node)
-       end 
-       return dir
-end
+dir = posix.dir
 
 -- Alias for posix.mkdir
 mkdir = posix.mkdir
index 5724b2c..d6f6511 100644 (file)
@@ -30,7 +30,7 @@ require("ffluci.util")
 require("ffluci.sys")
 
 -- Default modelpath
-modelpath = ffluci.sys.libpath() .. "/model/menu/"
+modelpattern = ffluci.sys.libpath() .. "/model/menu/*.lua"
 
 -- Menu definition extra scope
 scope = {
@@ -100,12 +100,11 @@ end
 function collect()
        local generators = {}
        
-       for k, menu in pairs(ffluci.fs.dir(modelpath)) do
-               if menu:sub(1, 1) ~= "." then
-                       local f = loadfile(modelpath.."/"..menu)
-                       if f then
-                               table.insert(generators, f)
-                       end
+       local m = ffluci.fs.glob(modelpattern) or {}
+       for k, menu in pairs(m) do
+               local f = loadfile(menu)
+               if f then
+                       table.insert(generators, f)
                end
        end