diff mbox series

package_rpm: set a timestamp handling policy with the new macro %build_mtime_policy

Message ID 20250103085324.3171320-1-bin.lan.cn@windriver.com
State Accepted, archived
Commit fa9b9e599bbf3ac73c7a9b1d15ccb0e0bbbe4c11
Headers show
Series package_rpm: set a timestamp handling policy with the new macro %build_mtime_policy | expand

Commit Message

Bin Lan Jan. 3, 2025, 8:53 a.m. UTC
There is the following warning when the do_package_write_rpm task is executed
when bitbake linux-yocto:
  warning: %clamp_mtime_to_source_date_epoch is deprecated, please use %build_mtime_policy

After RPM is upgraded to 4.20.0, the %clamp_mtime_to_source_date_epoch macro is
now deprecated in favor of %build_mtime_policy set to clamp_to_source_date_epoch.

Signed-off-by: Bin Lan <bin.lan.cn@windriver.com>
---
 meta/classes-global/package_rpm.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Alexander Kanavin Jan. 3, 2025, 10:25 a.m. UTC | #1
Thanks, this looks better.

Alex

On Fri, 3 Jan 2025 at 09:53, Bin Lan via lists.openembedded.org
<bin.lan.cn=windriver.com@lists.openembedded.org> wrote:
>
> There is the following warning when the do_package_write_rpm task is executed
> when bitbake linux-yocto:
>   warning: %clamp_mtime_to_source_date_epoch is deprecated, please use %build_mtime_policy
>
> After RPM is upgraded to 4.20.0, the %clamp_mtime_to_source_date_epoch macro is
> now deprecated in favor of %build_mtime_policy set to clamp_to_source_date_epoch.
>
> Signed-off-by: Bin Lan <bin.lan.cn@windriver.com>
> ---
>  meta/classes-global/package_rpm.bbclass | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/meta/classes-global/package_rpm.bbclass b/meta/classes-global/package_rpm.bbclass
> index 3579d0d695..f383ed140e 100644
> --- a/meta/classes-global/package_rpm.bbclass
> +++ b/meta/classes-global/package_rpm.bbclass
> @@ -699,7 +699,7 @@ python do_package_rpm () {
>      cmd = cmd + " --define '_smp_ncpus_max 4'"
>      cmd = cmd + " --define '_source_payload %s'" % rpmbuild_compmode
>      cmd = cmd + " --define '_binary_payload %s'" % rpmbuild_compmode
> -    cmd = cmd + " --define 'clamp_mtime_to_source_date_epoch 1'"
> +    cmd = cmd + " --define 'build_mtime_policy clamp_to_source_date_epoch'"
>      cmd = cmd + " --define 'use_source_date_epoch_as_buildtime 1'"
>      cmd = cmd + " --define '_buildhost reproducible'"
>      cmd = cmd + " --define '__font_provides %{nil}'"
> --
> 2.34.1
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#209326): https://lists.openembedded.org/g/openembedded-core/message/209326
> Mute This Topic: https://lists.openembedded.org/mt/110403448/1686489
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [alex.kanavin@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
diff mbox series

Patch

diff --git a/meta/classes-global/package_rpm.bbclass b/meta/classes-global/package_rpm.bbclass
index 3579d0d695..f383ed140e 100644
--- a/meta/classes-global/package_rpm.bbclass
+++ b/meta/classes-global/package_rpm.bbclass
@@ -699,7 +699,7 @@  python do_package_rpm () {
     cmd = cmd + " --define '_smp_ncpus_max 4'"
     cmd = cmd + " --define '_source_payload %s'" % rpmbuild_compmode
     cmd = cmd + " --define '_binary_payload %s'" % rpmbuild_compmode
-    cmd = cmd + " --define 'clamp_mtime_to_source_date_epoch 1'"
+    cmd = cmd + " --define 'build_mtime_policy clamp_to_source_date_epoch'"
     cmd = cmd + " --define 'use_source_date_epoch_as_buildtime 1'"
     cmd = cmd + " --define '_buildhost reproducible'"
     cmd = cmd + " --define '__font_provides %{nil}'"