加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
add-dist-to-release-by-default.patch 1.08 KB
一键复制 编辑 原始数据 按行查看 历史
rwx403335 提交于 2021-12-27 19:59 . upgrade version to 4.17.0
From af9a2347cd725a8dbb6045d7d3e9661d524af110 Mon Sep 17 00:00:00 2001
From: openEuler Buildteam <buildteam@openeuler.org>
Date: Wed, 4 Mar 2020 16:12:58 +0800
Subject: [PATCH] add dist to release by default
---
build/parsePreamble.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/build/parsePreamble.c b/build/parsePreamble.c
index b0a17c8..cac899a 100644
--- a/build/parsePreamble.c
+++ b/build/parsePreamble.c
@@ -808,6 +808,11 @@ static rpmRC handlePreambleTag(rpmSpec spec, Package pkg, rpmTagVal tag,
case RPMTAG_VERSION:
case RPMTAG_RELEASE:
SINGLE_TOKEN_ONLY;
+ if (tag == RPMTAG_RELEASE) {
+ char *dist = rpmExpand("%{?dist}",NULL);
+ rasprintf(&field,"%s%s",field,dist);
+ free(dist);
+ }
if (rpmCharCheck(spec, field, ALLOWED_CHARS_VERREL))
goto exit;
headerPutString(pkg->header, tag, field);
@@ -987,6 +992,8 @@ static rpmRC handlePreambleTag(rpmSpec spec, Package pkg, rpmTagVal tag,
}
rc = RPMRC_OK;
exit:
+ if (tag == RPMTAG_RELEASE)
+ free(field);
return rc;
}
--
1.8.3.1
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化