From d25a31bd2183f101d6836af54ed8eafbd9057700 Mon Sep 17 00:00:00 2001 From: Boris Nagaev Date: Sun, 21 Feb 2016 16:41:51 +0300 Subject: build-pkg: move function isBuilt() It will be used in buildItem() --- tools/build-pkg.lua | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/tools/build-pkg.lua b/tools/build-pkg.lua index e866abc..7a7172f 100755 --- a/tools/build-pkg.lua +++ b/tools/build-pkg.lua @@ -548,6 +548,18 @@ local function removeEmptyDirs(item) end end +local function isBuilt(item, files) + local target, pkg = parseItem(item) + local INSTALLED = 'usr/%s/installed/%s' + local installed = INSTALLED:format(target, pkg) + for _, file in ipairs(files) do + if file == installed then + return true + end + end + return false +end + -- builds package, returns list of new files local function buildItem(item, item2deps, file2item, item2index, pass) gitCheckout( @@ -692,18 +704,6 @@ local function makeDeb(item, files, deps, ver) makePackage(deb_pkg, files, deb_deps, ver, d1, d2) end -local function isBuilt(item, files) - local target, pkg = parseItem(item) - local INSTALLED = 'usr/%s/installed/%s' - local installed = INSTALLED:format(target, pkg) - for _, file in ipairs(files) do - if file == installed then - return true - end - end - return false -end - local function findForeignInstalls(item, files) for _, file in ipairs(files) do local pattern = 'usr/([^/]+)/installed/([^/]+)' -- cgit v0.12