Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 612548 - app-portage/repoman: Add possibility to template version/revision for repoman -M
Summary: app-portage/repoman: Add possibility to template version/revision for repoman -M
Status: RESOLVED WONTFIX
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Repoman (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-03-13 21:57 UTC by Mart Raudsepp
Modified: 2022-07-12 03:18 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mart Raudsepp gentoo-dev 2017-03-13 21:57:06 UTC
repoman -M template file currently supports a "cat/pkg: " special string for substituting it with the category and package for the message.
It would be nice if it also supported a version that includes the version number in the substitution when a single ebuild is updated.

So e.g when keywording foo/bar-1.0 ~arm64 I could use a template like:

"cat/pkg-ver: keyworded for ~arm64"
and get
"foo/bar-1.0-r0: keyworded for ~arm64"
as a result, like Blackb|rd's scripts do, which is very nice for git shortlog.

I suppose if it happens to touch multiple versions, it would skip the version/revision even if in template and fallback as if the template had "cat/pkg: ", as multiple revisions are touched (potentially with a fallback to not specify the revision if all touched revisions are for the same version).

This would allow us to do simple repoman commit -M scripting without rolling it manually to achieve this nicer message for better shortlog.
Comment 1 Arfrever Frehtes Taifersar Arahesis 2017-03-14 07:51:02 UTC
I think that policy for repository gentoo is to use "${CATEGORY}/${PN}: " prefix without "-${PV}" or "-${PVR}".
You can use something like "${CATEGORY}/${PN}: Keyworded 1.0 for ~arm64".
Comment 2 Mart Raudsepp gentoo-dev 2017-03-14 07:57:18 UTC
There is no such policy that I know of, just an example that happens to not include version number, as the example if probably more about a version bump or something.
And if there is such a policy, then it's wrong, considering what the convention for these things is in the git world - to signify what is changed (and a keywording is a change to a concrete package version/revision; while a bump could be considered a version bump for the whole package)
Comment 3 Mart Raudsepp gentoo-dev 2017-03-14 07:58:12 UTC
Additionally I still don't have access to the version touched in repoman -M, so that means I wouldn't be able to use repoman -M still, having to roll own scripts for no good reason when repoman -M is supposed to be helpful here.
Comment 4 Arfrever Frehtes Taifersar Arahesis 2017-03-14 08:13:30 UTC
See section "Git Commit Message Format" in https://devmanual.gentoo.org/ebuild-maintenance/index.html
Comment 5 Mart Raudsepp gentoo-dev 2017-03-14 08:35:55 UTC
Yes, "The summary line should start with referencing what is affected by the change followed by a colon ':' character." - so "cat/pkg-ver:", which is the thing affected by the change.

Either way, I can't do "${CATEGORY}/${PN}: Keyworded 1.0 for ~arm64" either with repoman -M as I can't template the 1.0 anywhere; prefix or not.
Comment 6 Brian Dolbec (RETIRED) gentoo-dev 2017-03-14 19:43:42 UTC
It could be possible to check for cat/pkg-ver: in the start of the commit message.

The main problem I see is it will take a bunch more code to determine the correct version.  Not just to get the version, but to ensure that there is only one ebuild being modified.

It is quite easy for repoman to get cat/pkg as it is very generic (simple directory lookup).  I'll have to think about getting the version from the files list for the commit.  It may not be too costly/painful. 

Of course patches/contributions are always welcome.
Comment 7 Mart Raudsepp gentoo-dev 2017-03-15 21:03:09 UTC
It might be nice to have some generic variable substitution in some form indeed, not just if it happens to be exactly line this at the very beginning. While for keywording/stabling I might like to tuck it before the ':', then for example with bumping I'd want to use "cat/pkg: bump to ${PV}", which I could then do via repoman -M template instead (of course then just a simple substitution of "ver" won't work out, as it might substitute things not wanted). I already use this, but it's only useful when doing some sort of batch bumping, like my gstreamer@ stuff, as I need to prepare the template file first and it is beneficial only thanks to it involving 70 packages that are getting all bumped to same version number due to the fact of tarball splitting.
Comment 8 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-07-12 03:18:36 UTC
repoman support has been removed per bug 835013.

Please file a new bug (or, I suppose, reopen this one) if you feel this check is still applicable to pkgcheck and doesn't already exist.