From 36159fcb370258188569df8e1be22fab3b7116ba Mon Sep 17 00:00:00 2001 From: Akira TAGOH Date: Mon, 19 Apr 2021 14:27:45 +0900 Subject: [PATCH] Borrow some code from fonts-rpm-macros, to drop a dependant code to generate srpm --- google-noto-fonts.spec | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/google-noto-fonts.spec b/google-noto-fonts.spec index e44467e..4a36128 100644 --- a/google-noto-fonts.spec +++ b/google-noto-fonts.spec @@ -573,6 +573,37 @@ local function wordwrap(text) return output end +-- A helper to close AppStream XML runs +local function closetag(oldtag, newtag) + if (oldtag == nil) then + return "" + else + local output = "]]>" + if (oldtag == "li") and (newtag ~= oldtag) then + output = output .. "" + end + return output + end +end + +-- A helper to open AppStream XML runs +local function opentag(oldtag, newtag) + if (newtag == nil) then + return "" + else + local output = "<" .. newtag .. ">" .. output + end + return output + end +end + +-- A helper to switch AppStream XML runs +local function switchtag(oldtag, newtag) + return closetag(oldtag, newtag) .. opentag(oldtag, newtag) +end + -- Reformat some text into something that can be included in an AppStream -- XML description local function txt2xml(text)