[Rpm-maint] [rpm-software-management/rpm] [Bug] Broken check for Name/Summary/Source0 existence (#572)

nim-nim notifications at github.com
Sun Oct 14 12:39:02 UTC 2018


RPM version 4.14.2

rpmbuild has a safety feature where it checks if Name/Summary/Source0 is defined while processing a spec. Unfortunately, the check is not placed correctly in the control flow.

So if you have a rpm macro that does something like:

```specfile
 %{lua:
-- If %{name} does not exist yet this this the first subpackage, that should own the package name
  if (not forcesub) and (forcemain or (rpm.expand("%{name}") == "%{name}")) then
    print('\\nName: ')
  else
    print('\\n%package   -n ')
  end
  print(packagename .. "\\n")
  print("Summary: " .. summary .. "\\n")
```

`rpmbuild` will fail and complain `Name` is not defined

Then if you force a manual `Name:` it will complain `Summary:` is not defined

Then if you supply `Summary` manually, it will process the macros, and fail *again* because this time it has noticed the macro `Summary` definition, there are two of them now, and that’s one too many for it.

Please move all the safety checks for tag existence just before `%prep` processing, **after** every macro call written before `%prep` in the spec file has been processed.  

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/572
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20181014/402e6131/attachment.html>


More information about the Rpm-maint mailing list