summaryrefslogtreecommitdiffstats
path: root/plugins/snippets/data/rpmspec.xml
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 14:32:59 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 14:32:59 +0000
commitadb934701975f6b0214475d1a8d0d1ce727b9d4d (patch)
tree5688c745d10b64c8856586864ec416a6bdae881d /plugins/snippets/data/rpmspec.xml
parentInitial commit. (diff)
downloadgedit-upstream.tar.xz
gedit-upstream.zip
Adding upstream version 3.38.1.upstream/3.38.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'plugins/snippets/data/rpmspec.xml')
-rw-r--r--plugins/snippets/data/rpmspec.xml22
1 files changed, 22 insertions, 0 deletions
diff --git a/plugins/snippets/data/rpmspec.xml b/plugins/snippets/data/rpmspec.xml
new file mode 100644
index 0000000..eb3396d
--- /dev/null
+++ b/plugins/snippets/data/rpmspec.xml
@@ -0,0 +1,22 @@
+<?xml version='1.0' encoding='utf-8'?>
+<!-- requires rpm-python package installed -->
+<snippets language="rpmspec">
+ <snippet id="ch">
+ <text><![CDATA[$<
+import rpm
+import datetime
+
+spec = rpm.spec($GEDIT_CURRENT_DOCUMENT_PATH)
+date = datetime.date.today().strftime("%a %b %d %Y")
+headers = spec.packages[0].header
+version = headers['Version']
+release = ".".join(headers['Release'].split(".")[:-1])
+packager = headers['Packager']
+newheader = "* %s %s - %s-%s\n- " % (date, packager, version, release)
+return newheader
+>
+]]></text>
+ <tag>ch</tag>
+ <description>changelog entry</description>
+ </snippet>
+</snippets>