diff options
author | Thomas Bracht Laumann Jespersen <t@laumann.xyz> | 2022-03-29 10:04:57 +0200 |
---|---|---|
committer | Arthur Zamarin <arthurzam@gmail.com> | 2022-04-07 22:28:44 +0300 |
commit | b8f38acafcc8ec41363401a8ef1649b8030efb8b (patch) | |
tree | 32ecf2c5c6034d838c24211ab8beed6893ce3285 | |
parent | Improve commit message for new package import (diff) | |
download | pkgdev-b8f38acafcc8ec41363401a8ef1649b8030efb8b.tar.gz pkgdev-b8f38acafcc8ec41363401a8ef1649b8030efb8b.tar.bz2 pkgdev-b8f38acafcc8ec41363401a8ef1649b8030efb8b.zip |
pkgdev mask: Extend mask comment template
To aid developers in writing comments for package.mask, extend the
comment in the temporary file to include example comments.
This is copied straight from the profiles/package.mask file in ::gentoo,
except I've left out the author line and the actual mask line (those are
added automatically).
Signed-off-by: Thomas Bracht Laumann Jespersen <t@laumann.xyz>
-rw-r--r-- | src/pkgdev/scripts/pkgdev_mask.py | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/pkgdev/scripts/pkgdev_mask.py b/src/pkgdev/scripts/pkgdev_mask.py index ec744be..1d93be5 100644 --- a/src/pkgdev/scripts/pkgdev_mask.py +++ b/src/pkgdev/scripts/pkgdev_mask.py @@ -3,6 +3,7 @@ import re import shlex import subprocess import tempfile +import textwrap from collections import deque from dataclasses import dataclass from datetime import datetime, timedelta, timezone @@ -168,7 +169,24 @@ class MaskFile: def get_comment(): """Spawn editor to get mask comment.""" tmp = tempfile.NamedTemporaryFile(mode='w') - tmp.write("\n\n# Please enter the mask message. Lines starting with '#' will be ignored.\n") + tmp.write(textwrap.dedent(""" + + # Please enter the mask message. Lines starting with '#' will be ignored. + # + # - Best last rites (removal) practices - + # + # Include the following info: + # a) reason for masking + # b) bug # for the removal (and yes you should have one) + # c) date of removal (either the date or "in x days") + # + # Example: + # + # Masked for removal in 30 days. Doesn't work + # with new libfoo. Upstream dead, gtk-1, smells + # funny. + # Bug #987654 + """)) tmp.flush() editor = shlex.split(os.environ.get('VISUAL', os.environ.get('EDITOR', 'nano'))) |