错误:补丁 2147483647 定义了多次

错误:补丁 2147483647 定义了多次

很抱歉这个神秘的标题,但这正是我得到的:

bash-4.2# rpmbuild --rebuild dcmtk-3.6.7-3.fc39.src.rpm
Installing dcmtk-3.6.7-3.fc39.src.rpm
warning: user mockbuild does not exist - using root
warning: group mock does not exist - using root
warning: user mockbuild does not exist - using root
warning: group mock does not exist - using root
warning: user mockbuild does not exist - using root
warning: group mock does not exist - using root
warning: user mockbuild does not exist - using root
warning: group mock does not exist - using root
error: patch 2147483647 defined multiple times

我的 rpmbuild 命令做错了什么?

以供参考:

bash-4.2# rpmbuild --version
RPM version 4.11.3

完整步骤:

% cat Dockerfile
FROM public.ecr.aws/lambda/dotnet:7
WORKDIR /tmp
RUN curl -O https://kojipkgs.fedoraproject.org//packages/dcmtk/3.6.7/3.fc39/src/dcmtk-3.6.7-3.fc39.src.rpm
RUN yum -y update && yum -y install rpm-build
RUN rpmbuild --rebuild dcmtk-3.6.7-3.fc39.src.rpm

同样适用于:

% cat Dockerfile
FROM public.ecr.aws/lambda/dotnet:7
WORKDIR /tmp
RUN curl -O https://kojipkgs.fedoraproject.org//packages/dcmtk/3.6.7/3.fc39/src/dcmtk-3.6.7-3.fc39.src.rpm
RUN yum -y update && yum -y install rpm-build cmake gcc-c++ libjpeg-devel \
 libpng-devel libtiff-devel libxml2-devel openssl-devel zlib-devel doxygen \
 git-core
RUN rpm -i dcmtk-3.6.7-3.fc39.src.rpm
WORKDIR  /root/rpmbuild/SPECS/
RUN rpmbuild -ba dcmtk.spec

结果是:

% docker build .
[...]
error: patch 2147483647 defined multiple times
The command '/bin/sh -c rpmbuild -ba dcmtk.spec' returned a non-zero code: 1

查看此处的 .spec 文件是定义的补丁:

% grep Patch: dcmtk.spec
Patch:      0001-Use-system-CharLS-include.patch
Patch:      0002-Add-FindCharLS.patch
Patch:      0003-Find-and-include-CharLS.patch
Patch:      0004-Use-cmake-suggested-locations-for-CharLS.patch
Patch:      0005-Correct-CharLS-API-call.patch
Patch:      0006-Remove-reference-to-bundled-CharLS.patch
Patch:      0007-Update-JLS_ERROR-to-jpegls_error-in-CharLS-usage.patch
Patch:      0008-Correct-JpegLsReadHeader-arguments.patch
Patch:      0009-Update-JlsParameters-for-new-CharLS.patch
Patch:      0010-Correct-JpegLsDecode-arguments-for-CharLS-2.patch
Patch:      0011-Update-ilv-for-new-CharLS.patch
Patch:      0012-Correct-extra-include-for-CharLS.patch
Patch:      0013-Update-errors-to-use-enum-class-in-CharLS-2.patch
Patch:      0014-Define-BYTE-for-CharLS.patch
Patch:      0015-Update-colorTransformation-for-CharLS-2.patch
Patch:      0016-Update-JpegLsEncode-for-CharLS-2.patch
Patch:      0017-Increase-sleep-for-tests.patch
Patch:      0018-CVE-2022-43272-Fixed-memory-leak-in-single-process-mode.patch

我发现我可以评论两个应用的补丁中的任何一个来解决此错误,例如:

sed -e '/0017-Increase-sleep-for-tests.patch/ s/^#*/#/' -i dcmtk.spec

但我很好奇这个数字是从哪里来2147483647的?

答案1

结果 amazonlinux/2 上的 rpmbuild 不支持带有多个补丁的“补丁:”。您必须使用明确的替代形式:

Patch0:        foo.patch
Patch1:        bar.patch

它可能会在以后的 amazonlinux 映像中得到修复。

参考:

相关内容