From 8adf3b2f035587e3ee1f39b4186d2226838a768f Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Thu, 23 Jan 2014 16:02:52 +0000 Subject: db: implement git_describe() so we can get the git describe string from aport. This is used as description for the APKINDEX. --- aports/db.lua | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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 -- cgit v1.2.3