代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/rpm 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From a58725822651f791b2e74fe40a6e85b3b7e72aca Mon Sep 17 00:00:00 2001
From: Panu Matilainen <[email protected]>
Date: Mon, 10 Aug 2020 11:01:37 +0300
Subject: [PATCH] Fix changelog trimming to work relative to newest
existing
entry (#1301)
%_changelog_trimtime is an absolute timestamp which needs to be
%constantly
pushed forward to preserve the same relative age, and will start
trimming
entries from unchanged packages until none are left, leading to
unexpected
and confusing behavior (RhBug:1722806, ...)
It's better to trim by age relative to newest changelog entry. This way
the
number of trimmed entries will not change unless the spec changes, and
at
least one entry is always preserved. Introduce a new %_changelog_trimage
macro for this and mark the broken by design %_changelog_trimtime as
deprecated, but autoconvert an existing trimtime into relative for now.
As a seemingly unrelated change, move the "time" variable declaration
to a narrower scope to unmask the time() function for use on entry.
Fixes: #1301
---
build/parseChangelog.c | 16 +++++++++++++++-
macros.in | 6 +++++-
2 files changed, 20 insertions(+), 2 deletions(-)
diff --git a/build/parseChangelog.c b/build/parseChangelog.c
index ad6d834..22f445e 100644
--- a/build/parseChangelog.c
+++ b/build/parseChangelog.c
@@ -200,18 +200,26 @@ static rpmRC addChangelog(Header h, ARGV_const_t sb)
rpmRC rc = RPMRC_FAIL; /* assume failure */
char *s, *sp;
int i;
- time_t time;
+ time_t firstTime = 0;
time_t lastTime = 0;
time_t trimtime = rpmExpandNumeric("%{?_changelog_trimtime}");
+ time_t trimage = rpmExpandNumeric("%{?_changelog_trimage}");
char *date, *name, *text, *next;
int date_words; /* number of words in date string */
+ /* Convert _changelog_trimtime to age for backwards compatibility */
+ if (trimtime && !trimage) {
+ trimage = time(NULL) - trimtime;
+ trimtime = 0;
+ }
+
s = sp = argvJoin(sb, "");
/* skip space */
SKIPSPACE(s);
while (*s != '\0') {
+ time_t time;
if (*s != '*') {
rpmlog(RPMLOG_ERR, _("%%changelog entries must start with *\n"));
goto exit;
@@ -235,6 +243,12 @@ static rpmRC addChangelog(Header h, ARGV_const_t sb)
rpmlog(RPMLOG_ERR, _("bad date in %%changelog: %s\n"), date);
goto exit;
}
+ /* Changelog trimming is always relative to first entry */
+ if (!firstTime) {
+ firstTime = time;
+ if (trimage)
+ trimtime = firstTime - trimage;
+ }
if (lastTime && lastTime < time) {
rpmlog(RPMLOG_ERR,
_("%%changelog not in descending chronological order\n"));
diff --git a/macros.in b/macros.in
index 8619c13..5b45d73 100644
--- a/macros.in
+++ b/macros.in
@@ -230,8 +230,12 @@ package or when debugging this package.\
# The path to the gzip executable (legacy, use %{__gzip} instead).
%_gzipbin %{__gzip}
+# Maximum age of preserved changelog entries in binary packages,
+# relative to newest existing entry. Unix timestamp format.
+%_changelog_trimage 0
+
# The Unix time of the latest kept changelog entry in binary packages.
-# Any older entry is not packaged in binary packages.
+# DEPRACATED, use %_changelog_trimage instead.
%_changelog_trimtime 0
# If true, set the SOURCE_DATE_EPOCH environment variable
--
2.27.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。