#1 Use RPMTAG_NOT_FOUND macro instead of -1 (for RPM 4.19)
Merged a year ago by dcantrell. Opened a year ago by mdomonko.
rpms/ mdomonko/rpminspect rawhide  into  rawhide

@@ -0,0 +1,31 @@ 

+ commit 0ce349a220025a6f2bbdeb111dab2bcd88e1c374

+ Author: Michal Domonkos <mdomonko@redhat.com>

+ Date:   Thu May 18 15:58:53 2023 +0200

+ 

+     [fix] Use RPMTAG_NOT_FOUND macro instead of -1

+     

+     In RPM 4.19, the internal representation of the rpmTagVal type has been

+     changed from signed to unsigned.  That means, a plain check for the

+     value of -1 (tag not found) returned from rpmTagGetValue() now produces

+     a compiler warning.

+     

+     In order to fix that, we have to either explicitly cast the literal -1

+     to (uint32_t)-1 or just use the RPMTAG_NOT_FOUND macro readily provided

+     by RPM.

+     

+     Choose the latter since that's the supported way, really, it's also now

+     documented as such in the API docs for the rpmTagGetValue() function.

+ 

+ diff --git a/lib/inspect_modularity.c b/lib/inspect_modularity.c

+ index 8b49421..3c96b1a 100644

+ --- a/lib/inspect_modularity.c

+ +++ b/lib/inspect_modularity.c

+ @@ -181,7 +181,7 @@ static bool modularity_driver(struct rpminspect *ri, rpmfile_entry_t *file)

+  

+      /* Find how to find the header */

+      tv = rpmTagGetValue("modularitylabel");

+ -    if (tv == -1) {

+ +    if (tv == RPMTAG_NOT_FOUND) {

+          add_result(ri, &params);

+          free(params.msg);

+          return false;

file modified
+6 -2
@@ -1,6 +1,6 @@ 

  Name:           rpminspect

  Version:        1.11

- Release:        1%{?dist}

+ Release:        2%{?dist}

  Summary:        Build deviation compliance tool

  Group:          Development/Tools

  # librpminspect is licensed under the LGPLv3+, but 5 source files in
@@ -30,6 +30,7 @@ 

  Source0:        https://github.com/rpminspect/rpminspect/releases/download/v%{version}/%{name}-%{version}.tar.xz

  Source1:        https://github.com/rpminspect/rpminspect/releases/download/v%{version}/%{name}-%{version}.tar.xz.asc

  Source2:        gpgkey-62977BB9C841B965.gpg

+ Patch0:         rpminspect-1.11-use-RPMTAG_NOT_FOUND-macro.patch

  Requires:       librpminspect%{?_isa} = %{version}-%{release}

  

  BuildRequires:  meson
@@ -160,7 +161,7 @@ 

  

  %prep

  %{gpgverify} --keyring='%{SOURCE2}' --signature='%{SOURCE1}' --data='%{SOURCE0}'

- %autosetup

+ %autosetup -p1

  

  

  %build
@@ -197,6 +198,9 @@ 

  

  

  %changelog

+ * Mon May 22 2023 Michal Domonkos <mdomonko@redhat.com> - 1.11-2

+ - Use RPMTAG_NOT_FOUND macro instead of -1 (for RPM 4.19)

+ 

  * Fri Mar 03 2023 David Cantrell <dcantrell@redhat.com> - 1.11-1

  - Upgrade to rpminspect-1.11

  

no initial comment

I recognize that the release model here is not really patch-based so please let me know if you'd prefer to create a new tarball instead.

This is fine for now. I have Copr builds which are regenerated on each merge upstream and those builds are used in production by the gating services. Periodically I do a new release and update the packages in Fedora, but I don't have a strict schedule around when I do a new versioned release. So I will merge this PR for now and then on the next x.y release I do, this patch can go away in the SRPM.

Pull-Request has been merged by dcantrell

a year ago

Oh, that's interesting and makes a lot of sense, thanks for the explanation (and merging)!