#!/usr/bin/env python3 # LFS ChangeLog generator for trivial package addition, removal, and update from subprocess import Popen, PIPE from urllib.request import urlopen from os import getenv def get_entity(line): line = line[1:] if not line.startswith("= 2: pkg = fields[1].lower() pos = pkg.find(' ') if pos > 0: pkg = pkg[:pos] tic = fields[0] if len(fields) >= 3 and fields[2].startswith("high"): security.add(pkg) ticket[pkg] = tic print("Plain Text:") for (s, act) in [(upd, "Update to "), (add, "Add ")]: for i in s: pkgver = i + "-" + expand_entity(ent, i + "-version") out = act + pkgver if pkgver in ticket: out += ' (#' + ticket[pkgver] + ')' print(out) for i in rem: print("Remove", i) print("---------------------") print("XML") name = getenv("USER") for (s, act) in [(upd, "Update to "), (add, "Add ")]: for i in s: print(' ') pkgver = i + "-" + expand_entity(ent, i + "-version") out = ' [' + name + '] - ' + act + pkgver if pkgver in security: out += " (security fix)" out += "." if pkgver in ticket: out += " Fixes\n " out += "#" out += ticket[pkgver] + "." out += "" print(out) print(' ')