]> git.e2factory.org Git - e2factory.git/commitdiff
build system has support for building extensions now
authorGordon Hecker <gh@emlix.com>
Wed, 13 May 2009 09:35:29 +0000 (11:35 +0200)
committerGordon Hecker <gh@emlix.com>
Thu, 14 May 2009 08:57:38 +0000 (10:57 +0200)
extensions are built inside e2factory now

Signed-off-by: Gordon Hecker <gh@emlix.com>
Makefile
extensions/Makefile [new file with mode: 0644]
generic/e2lib.lua
global/e2-install-e2.lua.in
global/e2.conf.in

index 6fbe57d0e356007855cc68b7ec825752eb0f4616..98edc386f59f80b37ec2a314af523c031ab27044 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -25,7 +25,7 @@
 #  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 
-SUBDIRS    = lua generic global doc templates
+SUBDIRS    = lua generic global doc templates extensions
 LOCALSUBDIRS    = lua generic global local doc
 TOPLEVEL    = .
 
@@ -58,6 +58,7 @@ all: e2commit buildconfig.lua
        $(MAKE) -C global
        $(MAKE) -C doc/man
        $(MAKE) -C templates all
+       $(MAKE) -C extensions all
 
 # this target creates a file E2_COMMIT, holding the current E2_COMMIT 
 # string, and cleans the tree in case E2_COMMIT changed since the last 
@@ -84,6 +85,7 @@ install: all
        $(MAKE) -C local install
        $(MAKE) -C doc/man install
        $(MAKE) -C templates install
+       $(MAKE) -C extensions install
 
 uninstall:
        $(MAKE) -C lua uninstall
@@ -97,12 +99,14 @@ local: e2commit buildconfig.lua
        $(MAKE) -C generic local
        $(MAKE) -C local
        $(MAKE) -C templates local
+       $(MAKE) -C extensions local
 
 install-local:
        scripts/e2-locate-project-root
        $(MAKE) -C generic install-local
        $(MAKE) -C local install-local
        $(MAKE) -C templates install-local
+       $(MAKE) -C extensions install-local
        install -m 644 buildconfig.lua $(LOCALLIBDIR)
 
 doc:
diff --git a/extensions/Makefile b/extensions/Makefile
new file mode 100644 (file)
index 0000000..ef5bf7a
--- /dev/null
@@ -0,0 +1,57 @@
+#
+#  e2factory, the emlix embedded build system
+#
+#  Copyright (C) 2007-2009 Gordon Hecker <gh@emlix.com>, emlix GmbH
+#  Copyright (C) 2007-2009 Oskar Schirmer <os@emlix.com>, emlix GmbH
+#  Copyright (C) 2007-2008 Felix Winkelmann, emlix GmbH
+#  
+#  For more information have a look at http://www.e2factory.org
+#
+#  e2factory is a registered trademark by emlix GmbH.
+#
+#  This file is part of e2factory, the emlix embedded build system.
+#  
+#  e2factory is free software: you can redistribute it and/or modify
+#  it under the terms of the GNU General Public License as published by
+#  the Free Software Foundation, either version 3 of the License, or
+#  (at your option) any later version.
+#  
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+#  
+#  You should have received a copy of the GNU General Public License
+#  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+
+SUBDIRS    = $(shell ls | grep -v Makefile)
+TOPLEVEL   = ..
+
+include $(TOPLEVEL)/make.vars
+
+CLEAN_FILES = *~
+
+all:
+       @for s in $(SUBDIRS) ; do $(MAKE) -C $$s $@ ; done
+
+install:
+       @for s in $(SUBDIRS) ; do $(MAKE) -C $$s $@ ; done
+
+local:
+       @for s in $(SUBDIRS) ; do $(MAKE) -C $$s $@ ; done
+
+install-local:
+       @for s in $(SUBDIRS) ; do $(MAKE) -C $$s $@ ; done
+
+doc:
+       @for s in $(SUBDIRS) ; do $(MAKE) -C $$s $@ ; done
+
+install-doc:
+       @for s in $(SUBDIRS) ; do $(MAKE) -C $$s $@ ; done
+
+clean:
+       @for s in $(SUBDIRS) ; do $(MAKE) -C $$s $@ ; done
+       rm -f $(CLEAN_FILES)
+
+.PHONY: all install local install-local doc install-doc clean 
index e792d76aa2232a5bd3609a7d61098fcf15fb49e2..a9b764a0d9ad76ad8476f095ffb71f5904eddad1 100644 (file)
@@ -824,14 +824,8 @@ end
 -- @return the extension configuration table
 -- @return an error object on failure
 function e2lib.read_extension_config()
-  if e2util.exists(".e2/e2version") then
-    return false, new_error(
-      "Deprecated configuration file .e2/e2version exists.\n"..
-      "Move configuration to .e2/extensions")
-  end
   local e = new_error("reading extension config file: %s",
                                                e2lib.extension_config)
-  
   local rc = e2util.exists(e2lib.extension_config)
   if not rc then
     return false, e:append("config file does not exist")
index 4423870955e911be0aab3718b478d5a50999beb9..69a69f856704f43805c8909d7ee2c380079272f5 100755 (executable)
@@ -112,27 +112,21 @@ if e2util.exists(e2lib.extension_config) then
     e2lib.abort(e:cat(re))
   end
 else
-  -- parse .e2/e2version for compatibility to e2factory versions without
-  -- extension support (e2factory-2.3.0)
-  local s = e2lib.read_line(".e2/e2version")
-  local branch, tag = s:match("(%S+) (%S+)")
-  if not branch or not tag then
-    e2lib.abort(e:append("cannot parse e2 version"))
-  end
-  local ref
-  if tag == "^" then
-    e2lib.warnf("WOTHER", "using e2 version by branch")
-    ref = string.format("refs/heads/%s", branch)
-  else
-    ref = string.format("refs/tags/%s", tag)
-  end
-  -- build an extension table pointing to e2factory core only
-  extensions = {
-    {
-      name = "e2factory",
-      ref=ref,
-    }
-  }
+  e2lib.warnf("WOTHER", "extension configuration not available")
+  extensions = {}  -- empty list
+end
+
+local s = e2lib.read_line(".e2/e2version")
+local branch, tag = s:match("(%S+) (%S+)")
+if not branch or not tag then
+  e2lib.abort(e:append("cannot parse e2 version"))
+end
+local ref
+if tag == "^" then
+  e2lib.warnf("WOTHER", "using e2 version by branch")
+  ref = string.format("refs/heads/%s", branch)
+else
+  ref = string.format("refs/tags/%s", tag)
 end
 
 rc, re = e2lib.chdir(".e2")
@@ -140,13 +134,33 @@ if not rc then
   e2lib.abort(e:cat(re))
 end
 
+-- checkout e2factory itself
+local server = config.site.e2_server
+local location = config.site.e2_location
+local destdir = "e2"
+local skip_checkout = false
+e2lib.logf(2, "fetching e2factory (ref %s)", ref)
+rc, re = generic_git.git_clone_from_server(scache, server, location,
+                                               destdir, skip_checkout)
+if not rc then
+  e2lib.abort(e:cat(re))
+end
+e2lib.chdir(destdir)
+
+-- checkout ref
+local args = string.format("--track -b tmp '%s'", ref)
+rc, re = e2lib.git(nil, "checkout", args)
+if not rc then
+  e2lib.abort(e:cat(re))
+end
+
 for _,ex in ipairs(extensions) do
-  -- change to the project root directory
-  rc, re = e2lib.chdir(root .. "/.e2")
+  -- change to the e2factory extensions directory
+  rc, re = e2lib.chdir(root .. "/.e2/e2/extensions")
   if not rc then
     e2lib.abort(e:cat(re))
   end
-  print(string.format("installing extension: %s (tag %s)", ex.name, ex.ref))
+  e2lib.logf(2, "fetching extension: %s (tag %s)", ex.name, ex.ref)
   local server = config.site.e2_server
   local location = string.format("%s/%s.git", config.site.e2_base, ex.name)
   local destdir = ex.name
@@ -168,14 +182,19 @@ for _,ex in ipairs(extensions) do
   if not rc then
     e2lib.abort(e:cat(re))
   end
+end
 
-  -- build and install
-  local cmd = string.format("make PREFIX='%s' local install-local",
+-- build and install
+e2lib.logf(2, "building e2factory")
+rc, re = e2lib.chdir(root .. "/.e2/e2")
+if not rc then
+  e2lib.abort(e:cat(re))
+end
+local cmd = string.format("make PREFIX='%s' local install-local",
                                                                install_prefix)
-  rc, re = e2lib.callcmd_capture(cmd)
-  if not rc then
-    e2lib.abort(e:cat(re))
-  end
+rc, re = e2lib.callcmd_capture(cmd)
+if not rc then
+  e2lib.abort(e:cat(re))
 end
 
 e2lib.finish()
index fc591dd1086b70444c25fa098ac365ff7bb9c075..97bb40a976797f19af36142d6854a77054dd3e6b 100644 (file)
@@ -7,11 +7,10 @@ config {
        site = {
                e2_server = "projects",
                e2_location = "e2factory.git",
-               e2_base = "."
+               e2_base = ".",
                e2_branch = "e2factory-2.3",
                e2_tag = "e2factory-2.3.0",
                default_extensions = {
-                       { name = "e2factory", ref = "refs/heads/master", },
                },
        },
        tools = {