openSUSE / obs-build

OBS build script, can be used with OBS or stand alone
GNU General Public License v2.0
132 stars 183 forks source link

changelog2spec: emailonly option for debian too #1020

Open yvs2014 opened 1 month ago

yvs2014 commented 1 month ago

Hi everyone,

with osc build and debian changelog there's a bit annoying messages from rpmlint like:

pingpath.src: W: no-version-in-last-changelog
The latest changelog entry doesn't contain a version. Please insert the
version that is coherent with the version of the package and rebuild it.

it comes from changelog2spec when it auto-detects changelog in debian format. Following https://github.com/openSUSE/rpmlint-checks/issues/37 it's connected with email address wrapped into < > In this case parse_suse() emailonly option (https://github.com/openSUSE/obs-build/blob/master/changelog2spec#L133) can be useful to avoid this warning for debian changelog too, something like

diff --git a/changelog2spec b/changelog2spec
index 863ec18..e03805b 100755
--- a/changelog2spec
+++ b/changelog2spec
@@ -130,7 +130,6 @@ sub parse_suse {
   $dt = lc($dt);
   $who =~ s/^\s+//;
   $who =~ s/^-\s*//;
-  $who = $1 if $emailonly && $who =~ /\<(.*)\>/;
   $dt =~ /([0-9][0-9][0-9][0-9])/;
   $dline = $_;
   my $year = $1;
@@ -260,6 +259,7 @@ while(defined($_)) {
   } elsif ($format eq 'debian') {
     ($_, $t, $dline, $who, $changes) = parse_debian($_);
   }
+  $who = $1 if $emailonly && $who =~ /\<(.*)\>/;
   if (defined($lastt) && $lastt < $t) {
     die("changes file not incremental: $dline\n") if $test;
     warn("changes file not incremental: $dline\n");

if there's another options how to avoid that warning I would appreciate for hints