fix: 将缓存目录从/rom/cache移动到/packages/cache并确保目录存在

确保缓存目录与其它包相关文件位于同一位置,提高文件组织的一致性。同时在安装过程中检查并创建缓存目录。
This commit is contained in:
2025-09-02 09:55:42 +08:00
parent 9867d4522c
commit d292add15e
2 changed files with 6 additions and 1 deletions

View File

@@ -28,7 +28,7 @@ local pkg_config = {
repo_url = "https://example.com/leonos/packages", -- 包仓库URL
local_pkg_dir = "/packages", -- 本地包存储目录
installed_db = "/packages/installed.json", -- 已安装包数据库
cache_dir = "/rom/cache" -- 缓存目录
cache_dir = "/packages/cache" -- 缓存目录
}
-- 确保必要的目录存在

View File

@@ -145,6 +145,11 @@ end
ok()
bullet("Creating directories...")
-- 确保缓存目录存在
local cache_dir = "/packages/cache"
if not fs.exists(cache_dir) then
fs.makeDir(cache_dir)
end
for i=#to_dl, 1, -1 do
local v = to_dl[i]
if v.type == "tree" then