From a38f65392bc34cfd036c7af54ed4e550a061157d Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Thu, 9 Jan 2014 12:44:05 +0000 Subject: pkg: add optional subpkgname option to apk_file functions --- aports/pkg.lua | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'aports/pkg.lua') diff --git a/aports/pkg.lua b/aports/pkg.lua index 87637d9..0a08bfc 100644 --- a/aports/pkg.lua +++ b/aports/pkg.lua @@ -73,23 +73,23 @@ function M.get_repo_name(pkg) return string.match(pkg.dir, ".*/(.*)/.*") end -function M.get_apk_file_name(pkg) - return pkg.pkgname.."-"..pkg.pkgver.."-r"..pkg.pkgrel..".apk" +function M.get_apk_file_name(pkg, name) + return (name or pkg.pkgname).."-"..pkg.pkgver.."-r"..pkg.pkgrel..".apk" end -function M.get_apk_file_path(pkg) +function M.get_apk_file_path(pkg, name) if abuild.pkgdest ~= nil and abuild.pkgdest ~= "" then - return abuild.pkgdest.."/"..M.get_apk_file_name(pkg) + return abuild.pkgdest.."/"..M.get_apk_file_name(pkg, name) end - if abuild.repodest ~= nil and abuild.epodest ~= "" then - return abuild.repodest.."/"..M.get_repo_name(pkg).."/"..abuild.arch.."/"..M.get_apk_file_name(pkg) + if abuild.repodest ~= nil and abuild.repodest ~= "" then + return abuild.repodest.."/"..M.get_repo_name(pkg).."/"..abuild.arch.."/"..M.get_apk_file_name(pkg, name) end - return pkg.dir.."/"..M.get_apk_file_name(pkg) + return pkg.dir.."/"..M.get_apk_file_name(pkg, name) end -function M.apk_file_exists(pkg) +function M.apk_file_exists(pkg, name) -- technically we check if it is readable... - local filepath = M.get_apk_file_path(pkg) + local filepath = M.get_apk_file_path(pkg, name) local f = io.open(filepath) if f == nil then return false -- cgit v1.2.3