new_package: make subpackages work when %{source_name} and Name: disagree
Remove %new_package dependency on %{source_name} when creating subpackages by suffix. This way those subpackages still work even when the packager set %{source_name} to a value and Name: to another. Arguably, the packager is severily conflicted, and does not know what he wants to achieve, but this case is easy enough to accomodate by tweaking the decision tree. So let’s just make things work instead of blaming the packager.
This commit is contained in:
parent
a52af8dced
commit
0cb7566d95
17
common.lua
17
common.lua
@ -259,21 +259,15 @@ local function new_package(source_name, pkg_name, name_suffix, first, verbose)
|
||||
return
|
||||
end
|
||||
-- New processing
|
||||
if name_suffix and not pkg_name then
|
||||
pkg_name = name_suffix
|
||||
if source_name then
|
||||
pkg_name = source_name .. "-" .. name_suffix
|
||||
end
|
||||
end
|
||||
if not pkg_name then
|
||||
if not source_name then
|
||||
if not (pkg_name or name_suffix or source_name) then
|
||||
rpm.expand([[
|
||||
%{error:You need to set %%{source_name} or provide explicit package naming!}
|
||||
]])
|
||||
end
|
||||
if name_suffix then
|
||||
print(rpm.expand("%package " .. name_suffix))
|
||||
set("currentname", "%{source_name}-" .. name_suffix, verbose)
|
||||
else
|
||||
pkg_name = source_name
|
||||
end
|
||||
end
|
||||
if not source_name then
|
||||
source_name = pkg_name
|
||||
end
|
||||
@ -287,6 +281,7 @@ local function new_package(source_name, pkg_name, name_suffix, first, verbose)
|
||||
print(rpm.expand("%package -n " .. pkg_name))
|
||||
end
|
||||
set("currentname", pkg_name, verbose)
|
||||
end
|
||||
end
|
||||
|
||||
return {
|
||||
|
Loading…
Reference in New Issue
Block a user