如何在spec rpm中使用时间戳?

Bdf*_*dfy 2 rpm-spec

我可以使用当前时间戳(或白天,或其他uniq参数)作为规格rpm文件中的版本吗?

例如,像这样:

Release: 100%{?dist}.test.%{timestamp}
Run Code Online (Sandbox Code Playgroud)

Chr*_*nce 6

您可以做的是在前导码之前定义变量,然后在Release行上使用它.以下示例将版本号设置为(假设2013年9月12日)20130912.

%define build_timestamp %(date +"%Y%m%d")

...
Release: %{build_timestamp}
Run Code Online (Sandbox Code Playgroud)