From 531c7ab2e2f9d77a8b58c50b7b04902dd719dd36 Mon Sep 17 00:00:00 2001 From: Tobias Ulmer Date: Wed, 25 Jan 2017 20:47:12 +0100 Subject: [PATCH] Remove deprecated lazytag build mode Signed-off-by: Tobias Ulmer --- Changelog | 1 + generic/generic_git.lua | 4 ++-- local/policy.lua | 13 +------------ plugins/cvs.lua | 8 +++----- plugins/git.lua | 10 ++++------ plugins/svn.lua | 2 -- 6 files changed, 11 insertions(+), 27 deletions(-) diff --git a/Changelog b/Changelog index 451dd2e..69a2570 100644 --- a/Changelog +++ b/Changelog @@ -1,4 +1,5 @@ NEXT: + * Removed lazytag build mode, it was deprecated for a long time * Fix error in cvs source if cvsroot unset e2factory-2.3.16p0 diff --git a/generic/generic_git.lua b/generic/generic_git.lua index 9d22307..2eae8a3 100644 --- a/generic/generic_git.lua +++ b/generic/generic_git.lua @@ -756,9 +756,9 @@ end -- @return git refs string, or false on error. -- @return Error object on failure. function generic_git.sourceset2ref(sourceset, branch, tag) - if sourceset == "branch" or (sourceset == "lazytag" and tag == "^") then + if sourceset == "branch" then return string.format("refs/heads/%s", branch) - elseif sourceset == "tag" or (sourceset == "lazytag" and tag ~= "^") then + elseif sourceset == "tag" then return string.format("refs/tags/%s", tag) end diff --git a/local/policy.lua b/local/policy.lua index 5430550..4175db3 100644 --- a/local/policy.lua +++ b/local/policy.lua @@ -27,12 +27,6 @@ local err = require("err") local hash = require("hash") local strict = require("strict") ---- Get the source set identifier. --- @return string: the source set identifier -local function source_set_lazytag() - return "lazytag" -end - --- Get the source set identifier. -- @return string: the source set identifier local function source_set_tag() @@ -271,12 +265,7 @@ end function policy.default_build_mode(mode) local build_mode = {} - if mode == "lazytag" then - build_mode.source_set = source_set_lazytag - build_mode.buildid = buildid_buildid - build_mode.storage = storage_default - build_mode.deploy = false - elseif mode == "tag" then + if mode == "tag" then build_mode.source_set = source_set_tag build_mode.buildid = buildid_buildid build_mode.storage = storage_default diff --git a/plugins/cvs.lua b/plugins/cvs.lua index ea13648..0cac752 100644 --- a/plugins/cvs.lua +++ b/plugins/cvs.lua @@ -245,7 +245,7 @@ function cvs.cvs_source:sourceid(sourceset) hash.hash_append(hc, lid) end -- cvs specific - if sourceset == "tag" and self._tag ~= "^" then + if sourceset == "tag" then -- we rely on tags being unique with cvs hash.hash_append(hc, self._tag) else @@ -363,11 +363,9 @@ function cvs.cvs_source:prepare_source(sourceset, buildpath) "-r", } - if sourceset == "branch" or - (sourceset == "lazytag" and self:get_tag() == "^") then + if sourceset == "branch" then table.insert(argv, self:get_branch()) - elseif (sourceset == "tag" or sourceset == "lazytag") and - self:get_tag() ~= "^" then + elseif sourceset == "tag" then table.insert(argv, self:get_tag()) else return false, e:cat(err.new("source set not allowed")) diff --git a/plugins/git.lua b/plugins/git.lua index 19ad701..ae3184a 100644 --- a/plugins/git.lua +++ b/plugins/git.lua @@ -177,14 +177,14 @@ function git.git_source:git_commit_id(sourceset, check_remote) gitdir = e2lib.join(e2tool.root(), self:get_working(), ".git") - if sourceset == "branch" or (sourceset == "lazytag" and self:get_tag() == "^") then + if sourceset == "branch" then ref = string.format("refs/heads/%s", self:get_branch()) rc, re, id = generic_git.lookup_id(gitdir, false, ref) if not rc then return false, e:cat(re) end - elseif sourceset == "tag" or (sourceset == "lazytag" and self:get_tag() ~= "^") then + elseif sourceset == "tag" then ref = string.format("refs/tags/%s", self:get_tag()) rc, re, id = generic_git.lookup_id(gitdir, false, ref) @@ -567,11 +567,9 @@ function git.git_source:prepare_source(sourceset, buildpath) git_argv = generic_git.git_new_argv(gitdir, srcdir, "archive") table.insert(git_argv, "--format=tar") - if sourceset == "branch" or - (sourceset == "lazytag" and self:get_tag() == "^") then + if sourceset == "branch" then table.insert(git_argv, "refs/heads/" .. self:get_branch()) - elseif sourceset == "tag" or - (sourceset == "lazytag" and self:get_tag() ~= "^") then + elseif sourceset == "tag" then table.insert(git_argv, "refs/tags/" .. self:get_tag()) else error(err.new("invalid sourceset: %s", sourceset)) diff --git a/plugins/svn.lua b/plugins/svn.lua index f38ae0d..beb9a48 100644 --- a/plugins/svn.lua +++ b/plugins/svn.lua @@ -288,8 +288,6 @@ function svn.svn_source:sourceid(sourceset) elseif sourceset == "branch" then hash.hash_append(hc, self._branch) argv = { "info", svnurl.."/"..self._branch } - elseif sourceset == "lazytag" then - return false, err.new("svn source does not support lazytag mode") else return false, err.new("svn sourceid can't handle sourceset %q", sourceset) -- 2.39.5