1 Star 0 Fork 79

hugel/rpm

forked from src-openEuler/rpm 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-Fix-some-int-enum-confusion-in-the-build-code.patch 1.90 KB
一键复制 编辑 原始数据 按行查看 历史
hugel 提交于 2024-06-03 09:15 . Backport some patches from upstream
From f2eb6fa6ba77fbf5f62add8a01544cce8c0beb6b Mon Sep 17 00:00:00 2001
From: Panu Matilainen <pmatilai@redhat.com>
Date: Fri, 15 Mar 2024 16:41:28 +0200
Subject: [PATCH] Fix some int/enum confusion in the build code
These things are not really returning rpmRC values, especially as they
need to pass around RPMRC_MISSINGBUILDREQUIRES which is not part of the
enum.
For doRmSource(), 0 and 1 aren't any more enums values than 0 and -1 are,
and besides, the sole caller isn't even checking the return code.
Conflict:NA
Reference:https://github.com/rpm-software-management/rpm/commit/f2eb6fa6ba77fbf5f62add8a01544cce8c0beb6b
---
build/build.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/build/build.c b/build/build.c
index 8e6c8f842..69ab69fc9 100644
--- a/build/build.c
+++ b/build/build.c
@@ -78,7 +78,7 @@ static char * buildHost(void)
/**
*/
-static rpmRC doRmSource(rpmSpec spec)
+static int doRmSource(rpmSpec spec)
{
struct Source *p;
Package pkg;
@@ -100,7 +100,7 @@ static rpmRC doRmSource(rpmSpec spec)
}
}
exit:
- return !rc ? 0 : 1;
+ return rc;
}
/*
@@ -290,9 +290,9 @@ static int doBuildRequires(rpmSpec spec, int test)
return rc;
}
-static rpmRC doCheckBuildRequires(rpmts ts, rpmSpec spec, int test)
+static int doCheckBuildRequires(rpmts ts, rpmSpec spec, int test)
{
- rpmRC rc = RPMRC_OK;
+ int rc = RPMRC_OK;
rpmps ps = rpmSpecCheckDeps(ts, spec);
if (ps) {
@@ -323,9 +323,9 @@ static rpmRC doBuildDir(rpmSpec spec, int test, StringBuf *sbp)
return rc;
}
-static rpmRC buildSpec(rpmts ts, BTA_t buildArgs, rpmSpec spec, int what)
+static int buildSpec(rpmts ts, BTA_t buildArgs, rpmSpec spec, int what)
{
- rpmRC rc = RPMRC_OK;
+ int rc = RPMRC_OK;
int missing_buildreqs = 0;
int test = (what & RPMBUILD_NOBUILD);
char *cookie = buildArgs->cookie ? xstrdup(buildArgs->cookie) : NULL;
--
2.33.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/hugel/rpm.git
git@gitee.com:hugel/rpm.git
hugel
rpm
rpm
master

搜索帮助