summaryrefslogtreecommitdiffstats
path: root/aports/db.lua
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2014-01-23 16:02:52 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2014-01-23 16:04:33 +0000
commit8adf3b2f035587e3ee1f39b4186d2226838a768f (patch)
tree3aa8f6e868996c07d48a14fa0463e148212dcfb9 /aports/db.lua
parent6a3e565f81b70a720e5a0f7409c43d4843ce6b36 (diff)
downloadlua-aports-8adf3b2f035587e3ee1f39b4186d2226838a768f.tar.bz2
lua-aports-8adf3b2f035587e3ee1f39b4186d2226838a768f.tar.xz
db: implement git_describe()
so we can get the git describe string from aport. This is used as description for the APKINDEX.
Diffstat (limited to 'aports/db.lua')
-rw-r--r--aports/db.lua12
1 files changed, 12 insertions, 0 deletions
diff --git a/aports/db.lua b/aports/db.lua
index cf8f3e0..e625b4a 100644
--- a/aports/db.lua
+++ b/aports/db.lua
@@ -235,6 +235,18 @@ function Aports:each_in_build_order(namelist)
end)
end
+function Aports:git_describe()
+ local cmd = ("git --git-dir %s/.git describe"):format(self.aportsdir)
+ local f = io.popen(cmd)
+ if f == nil then
+ return nil
+ end
+ local result = f:read("*line")
+ f:read("*a")
+ f:close()
+ return result
+end
+
function M.new(aportsdir, ...)
local h = Aports
h.aportsdir = aportsdir