to this problem in the default configuration and is enabled now.
* support for per-project caches (using the %l format) in e2.conf is
no longer available. Cache is designed to be per user.
+ * the global interface version is no longer maintained in the file
+ .e2/version inside the project. Instead ./version on the server side
+ remains the only permanent copy and it is fetched to .e2/global-version
+ in the project environment
+ * the local tools check for their own support for the global interface
+ version in use.
e2factory-2.3.3
* use sha1 module instead of calling the sha1sum tool
@echo 'EXTRAVERSION="$(EXTRAVERSION)"' >>$@
@echo 'VERSION="$(VERSION)"' >>$@
@echo 'VERSIONSTRING="$(VERSIONSTRING)"' >>$@
+ @echo 'GLOBAL_INTERFACE_VERSION={' >>$@
+ @for x in $(GLOBAL_INTERFACE_VERSION) ; do echo " \"$$x\"," ; done >>$@
+ @echo '}' >>$@
@echo 'SYNTAX={' >>$@
@for x in $(SYNTAX) ; do echo " \"$$x\"," ; done >>$@
@echo '}' >>$@
buildnumber_server_url = nil,
template_path = string.format("%s/templates", buildconfig.SYSCONFDIR),
extension_config = ".e2/extensions",
+ global_interface_version_file = ".e2/global-version",
lock = nil,
logrotate = 5, -- configurable via config.log.logrotate
}
end
local p = {}
-p.version = 2 -- the project version
+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.server = sl.server -- the server
{ filename = "proj/licences", content=licences },
{ filename = "proj/env", content=env },
{ filename = "proj/config", content=pconfig },
- { filename = ".e2/version", content=version },
{ filename = ".e2/syntax", content=syntax },
{ filename = ".e2/e2version", content=e2version },
{ filename = ".gitignore", content=gitignore },
e2lib.abort(e:cat(re))
end
+-- write version file
+local rc, re = e2lib.write_file(e2lib.global_interface_version_file, string.format("%d\n", v))
+
-- call e2-install-e2
e2_install_e2 = string.format("'%s' '%s/e2-install-e2'",
buildconfig.LUA, buildconfig.TOOLDIR)
end
-- read the version from the first line
-local line, re = e2lib.read_line(".e2/version")
+local line, re = e2lib.read_line(e2lib.global_interface_version_file)
if not line then
e2lib.abort(e:cat(re))
end
info.project_location = l
e2lib.log(4, string.format("project location is %s", info.project_location))
+ -- read global interface version and check if this version of the local
+ -- tools supports the version used for the project
+ local line, re = e2lib.read_line(e2lib.global_interface_version_file)
+ if not line then
+ return false, e:cat(re)
+ end
+ info.global_interface_version = line:match("^%s*(%d+)%s*$")
+ local supported = false
+ for _,v in ipairs(buildconfig.GLOBAL_INTERFACE_VERSION) do
+ if v == info.global_interface_version then
+ supported = true
+ end
+ end
+ if not supported then
+ e:append("%s: Invalid global interface version",
+ e2lib.global_interface_version_file)
+ e:append("supported global interface versions are: %s",
+ table.concat(buildconfig.GLOBAL_INTERFACE_VERSION), " ")
+ return false, e
+ end
+
-- warn if deprecated config files still exist
local deprecated_files = {
"proj/servers",
"proj/default-results",
"proj/name",
"proj/release-id",
+ ".e2/version",
}
for _,f in ipairs(deprecated_files) do
local path = string.format("%s/%s", info.root, f)
# list the latest one first
SYNTAX = 2_3_2
+# Global interface version describes the server side data format
+# It is stored in a file named `version` in the server side project location.
+# This file is copied to .e2/global_version when checking out a project for
+# access by the local tools.
+#
+# List the latest one first. It will be used when creating new projects.
+GLOBAL_INTERFACE_VERSION = 2
+
# when creating a project a current set of local tools is requested
DEFAULT_LOCAL_BRANCH = master
DEFAULT_LOCAL_TAG = $(TAG)