commit da2a42e7413291e90cf3bda8ed61c12b4117ae5d
parent 4f989c6bcedf54ff0289f7b31f289787044f3fdd
Author: phoebos <ben@bvnf.space>
Date: Tue, 27 Jun 2023 17:19:50 +0100
pkg.find_version: use repo_dir instead of searching
Diffstat:
3 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/bliss/build.lua b/bliss/build.lua
@@ -62,7 +62,7 @@ local function build(env, arg)
local repo_dir = pkg.find(p, path)
local sources = pkg.find_sources(p, repo_dir)
- local version = pkg.find_version(p, path)
+ local version = pkg.find_version(p, repo_dir)
local caches = pkg.resolve(p, sources, env, repo_dir)
download.download_sources(env, p, sources, caches)
diff --git a/bliss/list.lua b/bliss/list.lua
@@ -11,7 +11,9 @@ local function list(env, arg)
table.sort(arg)
end
for _,a in ipairs(arg) do
- local ver = pkg.find_version(a, {env.sys_db})
+ local repo_dir = env.sys_db .. '/' .. a
+ local ver = pkg.find_version(a, repo_dir)
+
io.write(string.format("%s %s-%s\n", a, ver[1], ver[2]))
end
end
diff --git a/bliss/pkg.lua b/bliss/pkg.lua
@@ -23,9 +23,8 @@ local function find(name, path)
utils.die("'"..name.."' not found")
end
-local function find_version(pkg, path)
- local pkgpath = find(pkg, path)
- local v = pkgpath .. "/version"
+local function find_version(pkg, repo_dir)
+ local v = repo_dir .. "/version"
local ver = read_lines(v)
if #ver == 0 then utils.die(pkg, "error reading version") end