$(MAKE) -C extensions all
install: all
- mkdir -p $(DESTDIR)$(BINDIR)
- mkdir -p $(DESTDIR)$(LIBDIR)
- mkdir -p $(DESTDIR)$(LIBEXECDIR)
- mkdir -p $(DESTDIR)$(INCDIR)
- mkdir -p $(DESTDIR)$(MANDIR)
- mkdir -p $(DESTDIR)$(TOOLDIR)
- install -m 644 buildconfig.lua $(DESTDIR)$(LIBDIR)
+ $(MAKE) -C global install
$(MAKE) -C lua install
$(MAKE) -C generic install
- $(MAKE) -C global install
$(MAKE) -C local install
$(MAKE) -C doc/man install
$(MAKE) -C templates install
]]
module("cache", package.seeall)
+require("e2lib")
+require("transport")
+require("url")
--- cache
-- @class table
module("e2lib", package.seeall)
require("strict")
require("buildconfig")
+require("lock")
+require("err")
+require("plugin")
+require("tools")
+require("cache")
+require("luafile")
_version = "e2factory, the emlix embedded build system, version " ..
buildconfig.VERSION
global_interface_version_file = ".e2/global-version",
lock = nil,
logrotate = 5, -- configurable via config.log.logrotate
+ _version = _version,
+ _licence = _licence,
}
-- Interrupt handling
end
if globals.warn_category[category] == true then
local prefix = "Warning: "
- if log_debug then
+ if globals.log_debug then
prefix = string.format("Warning [%s]: ", category)
end
log(1, prefix .. string.format(format, ...))
if getlog(4) then
logflags = logflags .. " --v4"
end
- if log_debug then
+ if globals.log_debug then
logflags = logflags .. " --log-debug"
end
return " " .. logflags
category)
flag("log-debug", "enable logging of debugging output",
function()
- e2lib.log_debug = true
+ e2lib.globals.log_debug = true
return true
end,
category)
category)
flag("licence", "show licence information",
function()
- print(_version)
+ print(e2lib.globals._version)
print()
- print(_licence)
+ print(e2lib.globals._licence)
e2lib.finish(0)
end,
category)
-- @param rc number: return code, passed to e2lib.finish()
-- @return nil
function usage(rc)
- print(_version)
+ print(e2lib.globals._version)
print([[
Copyright (C) 2007-2009 by Gordon Hecker and Oskar Schirmer, emlix GmbH
Copyright (C) 2007-2008 by Felix Winkelmann, emlix GmbH
module("luafile", package.seeall)
+require("luafile_ll")
function new()
local f = {}
include $(TOPLEVEL)/make.vars
-VPATH = .:$(TOPLEVEL)/generic
+VPATH = .:$(TOPLEVEL)/generic:$(TOPLEVEL)
SCRIPTS =
GLOBALLUATOOLS = e2-create-project e2-fetch-project e2-install-e2 e2-root
GLOBALSHTOOLS = e2-locate-project-root e2ssh
GLOBALTOOLS = $(GLOBALLUATOOLS) $(GLOBALSHTOOLS)
CLEAN_FILES = *~ $(GLOBALTOOLS) *.lc e2 $(SCRIPTS) *.lua e2-su *.sh e2.conf
-
+LUA_LIBS = strict.lua collection.lua loader.lua plugin.lua e2lib.lua
+LUA_LIBS += e2option.lua hash.lua tools.lua transport.lua cache.lua url.lua
+LUA_LIBS += generic_git.lua luafile.lua lua-version-map.lua err.lua lock.lua
+LUA_LIBS += buildconfig.lua
.PHONY: all install uninstall clean
all: e2 e2-root $(SCRIPTS) e2-su $(GLOBALLUATOOLS:=.lc) \
- $(GLOBALSHTOOLS:=.sh) e2.conf e2generic.lc sha1.so e2-su-2.2 \
+ $(GLOBALSHTOOLS:=.sh) e2.conf sha1.so e2-su-2.2 \
luafile_ll.so e2util.so
-install: all
+install-dirs:
+ install -d $(DESTDIR)$(BINDIR)
+ install -d $(DESTDIR)$(LIBDIR)
+ install -d $(DESTDIR)$(LIBEXECDIR)
+ install -d $(DESTDIR)$(INCDIR)
+ install -d $(DESTDIR)$(MANDIR)
+ install -d $(DESTDIR)$(TOOLDIR)
+ install -d $(DESTDIR)$(SYSCONFDIR)
+ install -d -m 2775 -g $(E2_GROUP) $(DESTDIR)$(LOCALSTATEDIR)
+
+install-lua: $(LUA_LIBS)
+ install -m 644 $^ $(DESTDIR)$(LIBDIR)
+
+install: all install-dirs install-lua
for i in $(GLOBALLUATOOLS) ; do \
install -m 755 $$i.lc $(DESTDIR)$(TOOLDIR)/$$i ; \
ln -sf e2 $(DESTDIR)$(BINDIR)/$$i ; \
install -m 755 e2-root $(DESTDIR)$(TOOLDIR)/
install -m 4754 -o root -g $(E2_GROUP) e2-su $(DESTDIR)$(BINDIR)/
install -m 755 e2 $(DESTDIR)$(BINDIR)/
- install -d $(DESTDIR)$(SYSCONFDIR)
if [ ! -f "$(DESTDIR)$(SYSCONFDIR)/e2.conf" ] ; then \
install -m 644 e2.conf $(DESTDIR)$(SYSCONFDIR)/e2.conf ; \
fi
install -m 644 e2.conf $(DESTDIR)$(SYSCONFDIR)/e2.conf.sample
- install -d -m 2775 -g $(E2_GROUP) $(DESTDIR)$(LOCALSTATEDIR)
- install -m 644 e2generic.lc $(DESTDIR)$(LIBDIR)
install -m 755 sha1.so $(DESTDIR)$(LIBDIR)
install -m 755 luafile_ll.so $(DESTDIR)$(LIBDIR)
install -m 755 e2util.so $(DESTDIR)$(LIBDIR)
rm -f $(DESTDIR)$(BINDIR)/$$i ; \
done
rm -f $(DESTDIR)$(BINDIR)/e2-su-2.2
- rm -f $(DESTDIR)$(LIBDIR)/e2generic.lc
rm -f $(DESTDIR)$(LIBDIR)/luafile_ll.so
rm -f $(DESTDIR)$(LIBDIR)/e2util.so
rm -f $(DESTDIR)$(TOOLDIR)/e2-root
e2.conf: e2.conf.in
$(TOPLEVEL)/scripts/genscript.sh $< $@
-e2generic.lc: strict.lua collection.lua loader.lua \
- plugin.lua \
- e2lib.lua e2option.lua hash.lua tools.lua \
- transport.lua cache.lua url.lua generic_git.lua \
- luafile.lua lua-version-map.lua \
- error.lua lock.lua
- $(BUILD_LUAC) -o $@ $^
-
sha1.so: sha1.o lsha1.o
luafile_ll.so: luafile_ll.o
]]
require("buildconfig")
-require("e2generic")
+require("e2lib")
+require("e2option")
+require("generic_git")
e2lib.init()
Create a new project and store it on <server> in <location>.
<server> defaults to '%s'.
]]
-e2option.documentation = string.format(doc, e2lib.default_projects_server)
+e2option.documentation = string.format(doc,
+ e2lib.globals.default_projects_server)
local opts = e2option.parse(arg)
local rc, e = e2lib.read_global_config()
-- standard global tool setup finished
-if e2lib.osenv["E2_LOCAL_TAG"] and e2lib.osenv["E2_LOCAL_BRANCH"] then
- e2lib.local_e2_branch = e2lib.osenv["E2_LOCAL_BRANCH"]
- e2lib.local_e2_tag = e2lib.osenv["E2_LOCAL_TAG"]
-elseif e2lib.osenv["E2_LOCAL_TAG"] then
- e2lib.local_e2_branch = "-"
- e2lib.local_e2_tag = e2lib.osenv["E2_LOCAL_TAG"]
-elseif e2lib.osenv["E2_LOCAL_BRANCH"] then
- e2lib.local_e2_branch = e2lib.osenv["E2_LOCAL_BRANCH"]
- e2lib.local_e2_tag = "^"
+if e2lib.globals.osenv["E2_LOCAL_TAG"] and e2lib.globals.osenv["E2_LOCAL_BRANCH"] then
+ e2lib.globals.local_e2_branch = e2lib.globals.osenv["E2_LOCAL_BRANCH"]
+ e2lib.globals.local_e2_tag = e2lib.globals.osenv["E2_LOCAL_TAG"]
+elseif e2lib.globals.osenv["E2_LOCAL_TAG"] then
+ e2lib.globals.local_e2_branch = "-"
+ e2lib.globals.local_e2_tag = e2lib.globals.osenv["E2_LOCAL_TAG"]
+elseif e2lib.globals.osenv["E2_LOCAL_BRANCH"] then
+ e2lib.globals.local_e2_branch = e2lib.globals.osenv["E2_LOCAL_BRANCH"]
+ e2lib.globals.local_e2_tag = "^"
else
- e2lib.local_e2_branch = config.site.e2_branch
- e2lib.local_e2_tag = config.site.e2_tag
+ e2lib.globals.local_e2_branch = config.site.e2_branch
+ e2lib.globals.local_e2_tag = config.site.e2_tag
end
if #opts.arguments ~= 1 then
end
local sl, re = e2lib.parse_server_location(opts.arguments[1],
- e2lib.default_projects_server)
+ e2lib.globals.default_projects_server)
if not sl then
e2lib.abort(e:cat(re))
end
local p = {}
p.version = buildconfig.GLOBAL_INTERFACE_VERSION[1] -- the project version
-p.e2version = string.format("%s %s", e2lib.local_e2_branch,
- e2lib.local_e2_tag)
+p.e2version = string.format("%s %s", e2lib.globals.local_e2_branch,
+ e2lib.globals.local_e2_tag)
p.server = sl.server -- the server
p.location = sl.location -- the project location
p.name = e2lib.basename(sl.location) -- the project basename
if not rc then
e2lib.abort(e:cat(re))
end
-rc, re = e2lib.git(nil, "add", e2lib.extension_config)
+rc, re = e2lib.git(nil, "add", e2lib.globals.extension_config)
if not rc then
e2lib.abort(e:cat(re))
end
]]
require("buildconfig")
-require("e2generic")
+require("e2lib")
+require("e2option")
+require("generic_git")
e2lib.init()
local e = new_error("fetching project failed")
<destination>.
<server> defaults to '%s'.
]]
-e2option.documentation = string.format(doc, e2lib.default_projects_server)
+e2option.documentation = string.format(doc,
+ e2lib.globals.default_projects_server)
e2option.flag("binary", "install binary local tools [broken]")
e2option.option("branch", "retrieve a specific project branch")
end
local sl, re = e2lib.parse_server_location(opts.arguments[1],
- e2lib.default_projects_server)
+ e2lib.globals.default_projects_server)
if not sl then
e2lib.abort(e:cat(re))
end
end
-- write version file
-local rc, re = e2lib.write_file(e2lib.global_interface_version_file, string.format("%d\n", v))
+local rc, re = e2lib.write_file(e2lib.globals.global_interface_version_file,
+ string.format("%d\n", v))
-- call e2-install-e2
e2_install_e2 = string.format("'%s' '%s/e2-install-e2'",
]]
require("buildconfig")
-require("e2generic")
+require("e2lib")
+require("e2option")
+require("generic_git")
install_prefix = buildconfig.PREFIX
end
-- read the version from the first line
-local line, re = e2lib.read_line(e2lib.global_interface_version_file)
+local line, re = e2lib.read_line(e2lib.globals.global_interface_version_file)
if not line then
e2lib.abort(e:cat(re))
end
e2lib.logf(2, "installing local tools")
local extensions
-if e2util.exists(e2lib.extension_config) then
+if e2util.exists(e2lib.globals.extension_config) then
extensions, re = e2lib.read_extension_config()
if not extensions then
e2lib.abort(e:cat(re))
package.cpath = "@LIBDIR@/?.so"
require("buildconfig")
-require("e2generic")
+require("e2lib")
+require("e2option")
+require("e2util")
+
e2lib.init()
e2option.documentation = [[