@ffesti commented on this pull request.


> @@ -151,17 +151,37 @@ static int addTE(rpmte p, Header h, fnpyKey key, 
> rpmRelocation * relocs)
     p->release = headerGetAsString(h, RPMTAG_RELEASE);
 
     /* name, version and release are required in all packages */
-    if (p->name == NULL || p->version == NULL || p->release == NULL)
-       goto exit;
+    for (auto [value, name] : std::vector<std::pair<char *, std::string>>
+            {{p->name, "name"},
+             {p->version, "version"},
+             {p->release, "release"}}) {
+       if (value == NULL) {
+           rpmlog(RPMLOG_ERR, _("Package is missing %s\n"), name.c_str());
+           goto exit;

Hey, I was sooo proud of getting this loop to actually work...

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/3478#discussion_r1865440899
You are receiving this because you are subscribed to this thread.

Message ID: <rpm-software-management/rpm/pull/3478/review/2472062...@github.com>
_______________________________________________
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
https://lists.rpm.org/mailman/listinfo/rpm-maint

Reply via email to