diff options
-rw-r--r-- | pm.lua | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -7,6 +7,10 @@ local function perr(err,what) end local _manifests = {} +local function clear_cache() + for k in pairs(_manifests) do _manifests[k] = nil end +end + local function manifest(pkgname) if _manifests[pkgname] then return _manifests[pkgname] end print("fetching manifest of '"..pkgname.."'...") @@ -52,7 +56,6 @@ local function recursive_depsof(pkgname) local lookedat = {} local deps = {} local function F(pkgname) - print("F",pkgname) if not lookedat[pkgname] then lookedat[pkgname] = true for k,_ in pairs(manifest(pkgname).deps) do @@ -65,6 +68,15 @@ local function recursive_depsof(pkgname) return deps end +local function recursive_filesof(pkgname) + local deps = recursive_depsof(pkgname) + local files = {} + for dep in pairs(deps) do + for file in pairs(manifest(dep).files) do files[file] = true end + end + return files +end + local function dlfile(filename) local file,err=fs.open("/"..filename,"w") if err then error("fs.open "..err) end |