Gentoo Archives: gentoo-portage-dev

From: Brian Dolbec <dolsen@g.o>
To: gentoo-portage-dev@l.g.o
Subject: [gentoo-portage-dev] [Patch] 1/1 New commitmsgfile "cat/pkg: " auto-substitution
Date: Thu, 15 Sep 2016 19:50:26
Message-Id: 20160915125013.1d16662d.dolsen@gentoo.org
1 From 08f6d22b366c8dc2968573ebc4fd4f0401ea67b7 Mon Sep 17 00:00:00 2001
2 From: Brian Dolbec <dolsen@g.o>
3 Date: Thu, 15 Sep 2016 12:45:10 -0700
4 Subject: [PATCH] repoman: Update man page and commitmsgfile option
5
6 Use .lower() on the leading message 9 charachters of hte message text for the substitution
7 test.
8 Update the man page for this new templating capability.
9 ---
10 repoman/man/repoman.1 | 6 +++++-
11 repoman/pym/repoman/actions.py | 2 +-
12 2 files changed, 6 insertions(+), 2 deletions(-)
13
14 diff --git a/repoman/man/repoman.1 b/repoman/man/repoman.1
15 index 4a9122e..8df3207 100644
16 --- a/repoman/man/repoman.1
17 +++ b/repoman/man/repoman.1
18 @@ -109,7 +109,11 @@ Behave as if no package.mask entries exist (not allowed with commit mode)
19 Adds a commit message via the command line
20 .TP
21 \fB-M\fR, \fB--commitmsgfile\fR
22 -Adds a commit message from the specified file
23 +Adds a commit message from the specified file. This option also will perform
24 +an automatic text substitution of a leading "cat/pkg: " string (upper or lower
25 +case) with the actual category/package prefix as defined by the required message
26 +format. Use this option for templating a common commit message for
27 multiple +package updates.
28 .TP
29 \fB-V\fR, \fB--version\fR
30 Show version info
31 diff --git a/repoman/pym/repoman/actions.py
32 b/repoman/pym/repoman/actions.py index 0534c29..9763c26 100644
33 --- a/repoman/pym/repoman/actions.py
34 +++ b/repoman/pym/repoman/actions.py
35 @@ -108,7 +108,7 @@ class Actions(object):
36 "
37 --commitmsgfile='%s'\n" % self.options.commitmsgfile) else:
38 raise
39 - if commitmessage[:9] in ("cat/pkg: ",
40 "CAT/PKG: "):
41 + if commitmessage[:9].lower() in ("cat/pkg: "):
42 commitmessage = self.msg_prefix() +
43 commitmessage[9:]
44 if not commitmessage or not commitmessage.strip():
45 --
46 2.9.3
47
48
49 --
50 Brian Dolbec <dolsen>

Replies