supplying %date for %forge macros optional (backwards compatible)
This commit is contained in:
parent
74b8dd05bb
commit
22833277e6
@ -8,7 +8,7 @@
|
|||||||
# Version if applicable, set it with Version: <version>
|
# Version if applicable, set it with Version: <version>
|
||||||
# tag if applicable
|
# tag if applicable
|
||||||
# commit if applicable
|
# commit if applicable
|
||||||
# date if applicable
|
# date if applicable (to override the mtime of the Source archive)
|
||||||
#
|
#
|
||||||
# The macro will attempt to compute and set the following variables if they are
|
# The macro will attempt to compute and set the following variables if they are
|
||||||
# not already set by the packager:
|
# not already set by the packager:
|
||||||
@ -256,7 +256,7 @@ if (distprefix == "") then
|
|||||||
distprefix = string.sub(rpm.expand("%{?commit}"), 1, 7)
|
distprefix = string.sub(rpm.expand("%{?commit}"), 1, 7)
|
||||||
end
|
end
|
||||||
if (distprefix ~= "") then
|
if (distprefix ~= "") then
|
||||||
local dist = ".%{date}.%{scm}" .. string.gsub(distprefix, "-",".") .. rpm.expand("%{?dist}")
|
local dist = ".%{?date}%{!?date:%([ -r %{_sourcedir}/%{archivename}.%{archiveext} ] && date +%Y%m%d -u -r %{_sourcedir}/%{archivename}.%{archiveext})}.%{scm}" .. string.gsub(distprefix, "-",".") .. rpm.expand("%{?dist}")
|
||||||
explicitset("dist", dist)
|
explicitset("dist", dist)
|
||||||
end
|
end
|
||||||
-- Final spec variable summary if the macro was called with -i
|
-- Final spec variable summary if the macro was called with -i
|
||||||
@ -272,7 +272,7 @@ if informative then
|
|||||||
rpm.expand("%{echo: scm: %{?scm}\\n}")
|
rpm.expand("%{echo: scm: %{?scm}\\n}")
|
||||||
rpm.expand("%{echo: tag: %{?tag}\\n}")
|
rpm.expand("%{echo: tag: %{?tag}\\n}")
|
||||||
rpm.expand("%{echo: commit: %{?commit}\\n}")
|
rpm.expand("%{echo: commit: %{?commit}\\n}")
|
||||||
rpm.expand("%{echo: dist: %{?dist}\\n}")
|
rpm.expand("%{echo: dist: %{?dist} (snapshot date is either manually supplied or computed once %%{_sourcedir}/%%{archivename}.%%{archiveext} is available)\\n}")
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -280,4 +280,4 @@ end
|
|||||||
%forgesetup(a:b:cDn:Tq) %setup %{?forgesetupargs} %{-a} %{-b} %{-c} %{-D} %{-n} %{-T} %{-q}
|
%forgesetup(a:b:cDn:Tq) %setup %{?forgesetupargs} %{-a} %{-b} %{-c} %{-D} %{-n} %{-T} %{-q}
|
||||||
|
|
||||||
# Convenience macro to relay computed arguments to %autosetup
|
# Convenience macro to relay computed arguments to %autosetup
|
||||||
%forgeautosetup(a:b:cDn:TvNS:p:) %autosetup %{?forgesetupargs} %{-a} %{-b} %{-c} %{-D} %{-n} %{-T} %{-v} %{-N} %{-S} %{-p}
|
%forgeautosetup(a:b:cDn:TvNS:p:) %autosetup %{?forgesetupargs} %{-a} %{-b} %{-c} %{-D} %{-n} %{-T} %{-v} %{-N} %{-S} %{-p}
|
||||||
|
Loading…
Reference in New Issue
Block a user