On 10/3/19 10:29 AM, Daniel P. Berrangé wrote:
On Thu, Oct 03, 2019 at 10:21:37AM -0400, David Cantrell wrote:
On 10/3/19 10:16 AM, Chris Adams wrote:
Once upon a time, Matthew Miller <mat...@fedoraproject.org> said:
I think rather than this, we should bite the bullet and remove changelogs
entirely from spec files.

I find "rpm -q --changelog" useful (at least when maintainers put useful
info there, which isn't always), so please don't.

I am in favor of removing changelogs from spec files, but I do understand
that some people find them useful.  How about a meet halfway point and have
a macro that maintainers can use to automatically generate spec file
changelog blocks for projects which we are also the upstream for?

I have this silly script to generate an spec file changelog block (complete
with the hyphen prefixing and wrapping of lines and escaping percent signs)
that generates a block from the most recent tag on a git repo:

==========
#!/bin/sh

PATH=/usr/bin
CWD="$(pwd)"

LATEST_TAG="$(git tag --sort=taggerdate | tail -n 1)"

git log --format=%s ${LATEST_TAG}.. | tac | while read line ; do
     first=1
     echo "${line}" | sed -e 's|%|%%|g' | fold -s -w 70 | \
     while read subline ; do
         if [ ${first} -eq 1 ]; then
             echo "- ${subline}"
             first=0
         else
             echo "  ${subline}"
         fi
     done
done
==========


I take this output and paste it in the spec file and then delete the lines I
don't want.  Could be expanded to take a repo as a parameter, etc.

Or just add some RPM metadata tags to record the upstream SCM type + URL +
branch / release tag, etc. The user can thus easily find the upstream
full commit logs corresponding to the pacakge.

That works too. A %global upstream_changelog and "rpm -q --changelog" could look for that and display the value if it exists --or-- pull down the info and display it for minimal impact to current users.

--
David Cantrell <dcantr...@redhat.com>
Red Hat, Inc. | Boston, MA | EST5EDT
_______________________________________________
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org

Reply via email to