Hi Samueloph,

On Tue, Feb 14, 2023 at 11:16:11PM +0000, Samuel Henrique wrote:
> Package: git-buildpackage
> X-Debbugs-Cc: samuel...@debian.org
> Version: 0.9.30
> Severity: normal
> Tags: patch
> 
> As stated in the title, the changelog header has the wrong format.
> 
> Specfile documentation:
> https://rpm-packaging-guide.github.io/#working-with-spec-files
> ...
>  Follow this format for the first line:
> 
>  * Day-of-Week Month Day Year Name Surname <email> - Version-Release
> ...

This makes sense. Fedora uses the same format, e.g.

   https://src.fedoraproject.org/rpms/phosh/blob/rawhide/f/phosh.spec

You need to fixup the tests too though, e.g.:

======================================================================
FAIL: Test set_header() method
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File 
"/var/scratch/src/git-buildpackage/git-buildpackage/tests/30_test_rpm_changelog.py",
 line 99, in test_set_header
    eq_(str(section), "* Thu Jan 30 2014 Jane <u@h> 1.1\n- my change\n\n")
AssertionError: '* Thu Jan 30 2014 Jane <u@h> - 1.1\n- my change\n\n' != '* Thu 
Jan 30 2014 Jane <u@h> 1.1\n- my change\n\n'

Cheers,
 -- Guido




> 
> I have provided a patch on Github at
> https://github.com/agx/git-buildpackage/pull/89
> 
> The patch is also attached to this bug report.
> 
> Thank you,
> 
> -- 
> Samuel Henrique <samueloph>

> From 310db2177f3a43e1584682f21c43ac0de6c495e6 Mon Sep 17 00:00:00 2001
> From: Samuel Henrique <samuel...@debian.org>
> Date: Mon, 1 Aug 2022 18:49:19 +0100
> Subject: [PATCH] Fix RPM changelog header format (missing dash before version)
> 
>  As stated in the documentation at:
>  https://rpm-packaging-guide.github.io/#working-with-spec-files
> 
>  "...
>  Follow this format for the first line:
> 
>  * Day-of-Week Month Day Year Name Surname <email> - Version-Release
>  ..."
> ---
>  gbp/rpm/policy.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/gbp/rpm/policy.py b/gbp/rpm/policy.py
> index a2155e20..59989bb8 100644
> --- a/gbp/rpm/policy.py
> +++ b/gbp/rpm/policy.py
> @@ -85,7 +85,7 @@ class Changelog(object):
>          body_name_re = r'\[(?P<name>.*)\]'
>  
>          # Changelog header format (when writing out changelog)
> -        header_format = "* %(time)s %(name)s <%(email)s> %(revision)s"
> +        header_format = "* %(time)s %(name)s <%(email)s> - %(revision)s"
>          header_time_format = "%a %b %d %Y"
>          header_rev_format = "%(version)s"
>  

Reply via email to