From afde76f75ffce946ad50b07cf5ae8e3c97e908c1 Mon Sep 17 00:00:00 2001 From: Tobias Ulmer Date: Tue, 20 Sep 2016 16:55:08 +0200 Subject: [PATCH] cache: rename root_server to dot Signed-off-by: Tobias Ulmer --- generic/cache.lua | 5 ++--- local/chroot.lua | 2 +- local/e2-new-source.lua | 2 +- local/e2build.lua | 4 ++-- local/licence.lua | 2 +- local/policy.lua | 2 +- local/project.lua | 2 +- local/result.lua | 2 +- plugins/collect_project.lua | 8 ++++---- plugins/files.lua | 2 +- 10 files changed, 15 insertions(+), 16 deletions(-) diff --git a/generic/cache.lua b/generic/cache.lua index 0fa5010..5300204 100644 --- a/generic/cache.lua +++ b/generic/cache.lua @@ -128,7 +128,7 @@ function cache.setup_cache_local(c, project_root, project_location) servers = cache.server_names() - rc, re = cache.new_cache_entry(c, servers.root_server, + rc, re = cache.new_cache_entry(c, servers.dot, "file://" .. project_root, { writeback=true }, nil, nil) if not rc then return false, re @@ -147,8 +147,7 @@ function cache.setup_cache_local(c, project_root, project_location) end local _server_names = strict.lock({ - -- XXX: inconsistent, confusing naming scheme - root_server = ".", + dot = ".", -- the proj_storage server is equivalent to -- projects:info.project-locaton proj_storage = "proj-storage", diff --git a/local/chroot.lua b/local/chroot.lua index 98a55e3..5659f4e 100644 --- a/local/chroot.lua +++ b/local/chroot.lua @@ -291,7 +291,7 @@ function chroot.load_chroot_config(info) return false, e end - if f.server ~= cache.server_names().root_server and not f.sha1 then + if f.server ~= cache.server_names().dot and not f.sha1 then e:append("in group: %s", grp.name) e:append("file entry for remote file without `sha1` attribute") return false, e diff --git a/local/e2-new-source.lua b/local/e2-new-source.lua index b131b8e..7df8537 100644 --- a/local/e2-new-source.lua +++ b/local/e2-new-source.lua @@ -256,7 +256,7 @@ local function e2_new_source(arg) local name = arguments[1] local rlocation = string.format("%s/git/%s.git", info.project_location, name) -- local - local lserver = cache.server_names().root_server + local lserver = cache.server_names().dot local llocation = string.format("in/%s/.git", name) local rc, re = generic_git.new_repository(info.cache, lserver, llocation, rserver, rlocation) diff --git a/local/e2build.lua b/local/e2build.lua index c5f668a..b8e98c9 100644 --- a/local/e2build.lua +++ b/local/e2build.lua @@ -411,7 +411,7 @@ function e2build.build_process_class:_install_build_script(res, return_flags) destdir = e2lib.join(bc.T, "script") info = e2tool.info() - rc, re = cache.fetch_file(info.cache, cache.server_names().root_server, + rc, re = cache.fetch_file(info.cache, cache.server_names().dot, location, destdir) if not rc then e = err.new("installing build script") @@ -461,7 +461,7 @@ function e2build.build_process_class:_install_init_files(res, return_flags) end rc, re = cache.fetch_file(info.cache, - cache.server_names().root_server, location, destdir) + cache.server_names().dot, location, destdir) if not rc then return false, e:cat(re) end diff --git a/local/licence.lua b/local/licence.lua index 7e57ae8..ea8544c 100644 --- a/local/licence.lua +++ b/local/licence.lua @@ -245,7 +245,7 @@ function licence.load_licence_config(info) if not rc then return false, e:cat(re) end - if file.server ~= cache.server_names().root_server and not file.sha1 then + if file.server ~= cache.server_names().dot and not file.sha1 then return false, e:append( "file entry for remote file without sha1 attribute") end diff --git a/local/policy.lua b/local/policy.lua index 4e0eac1..9ead949 100644 --- a/local/policy.lua +++ b/local/policy.lua @@ -87,7 +87,7 @@ end -- @return Server name (string). -- @return Location path to store results in (string). local function storage_local(location, release_id) - return cache.server_names().root_server , string.format("out") + return cache.server_names().dot , string.format("out") end --- Get deploy server and location. diff --git a/local/project.lua b/local/project.lua index bab28d6..2aa2877 100644 --- a/local/project.lua +++ b/local/project.lua @@ -264,7 +264,7 @@ function project.projid(info) if not e2lib.is_backup_file(f) then location = e2lib.join("proj/init", f) file = { - server = cache.server_names().root_server, + server = cache.server_names().dot, location = location, } diff --git a/local/result.lua b/local/result.lua index 2a7d93d..f07ebd1 100644 --- a/local/result.lua +++ b/local/result.lua @@ -493,7 +493,7 @@ function result.result_class:buildid() -- buildscript local file = { - server = cache.server_names().root_server, + server = cache.server_names().dot, location = e2tool.resultbuildscript(self:get_name_as_path()), } diff --git a/plugins/collect_project.lua b/plugins/collect_project.lua index 1fa3dad..57f7c50 100644 --- a/plugins/collect_project.lua +++ b/plugins/collect_project.lua @@ -233,7 +233,7 @@ function collect_project_class:buildid() -- buildscript local file = { - server = cache.server_names().root_server, + server = cache.server_names().dot, location = e2tool.resultbuildscript(self:get_name_as_path()), } @@ -420,7 +420,7 @@ function cp_build_process_class:_build_collect_project(res, return_flags) end e2lib.logf(3, "init file: %s", f) - local server = cache.server_names().root_server + local server = cache.server_names().dot local location = e2lib.join("proj/init", f) local cache_flags = {} rc, re = cache.fetch_file(info.cache, server, location, @@ -540,7 +540,7 @@ function cp_build_process_class:_build_collect_project(res, return_flags) e2tool.resultbuildscript(dep:get_name_as_path()) } for _,file in pairs(files) do - local server = cache.server_names().root_server + local server = cache.server_names().dot local cache_flags = {} rc, re = cache.fetch_file(info.cache, server, file, destdir, nil, cache_flags) @@ -611,7 +611,7 @@ function cp_build_process_class:_build_collect_project(res, return_flags) return false, e:cat(re) end -- install the global Makefiles - local server = cache.server_names().root_server + local server = cache.server_names().dot local destdir = e2lib.join(bc.T, "project") local cache_flags = {} local locations = { diff --git a/plugins/files.lua b/plugins/files.lua index 5828f74..8fa1e29 100644 --- a/plugins/files.lua +++ b/plugins/files.lua @@ -145,7 +145,7 @@ function files.files_source:initialize(rawsrc) if not f.location then error(e:append("file entry without `location' attribute")) end - if f.server ~= cache.server_names().root_server and not f.sha1 then + if f.server ~= cache.server_names().dot and not f.sha1 then error(e:append("file entry for remote file without ".. "`sha1` attribute")) end -- 2.39.5