Gentoo Archives: gentoo-portage-dev

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

Replies