我试图通过修改libc6中的prefix=/usr行来构建带有自定义前缀的debian/rules。但是,这失败了,因为修补程序被多次应用。奇怪的是,修补另一个文件不会导致相同的错误。我把失败归结为这个剧本:
#!/bin/bash
set -exuo pipefail
work_dir=$(mktemp -d)
cd "$work_dir"
apt-get source libc6
cd eglibc-2.19
cat <<'PATCH' > ../set-prefix.diff
Index: eglibc-2.19/debian/rules
===================================================================
--- eglibc-2.19.orig/debian/rules>2022-03-01 17:27:53.068299816 -0800
+++ eglibc-2.19/debian/rules>-2022-03-01 17:27:53.068299816 -0800
@@ -85,7 +85,7 @@
# Default setup
EGLIBC_PASSES ?= libc
-prefix=/usr
+prefix=/new/prefix
bindir=$(prefix)/bin
datadir=$(prefix)/share
localedir=$(prefix)/lib/locale
PATCH
cat <<'PATCH' > ../change-readme.diff
Index: eglibc-2.19/README
===================================================================
--- eglibc-2.19.orig/README 2013-10-18 14:33:25.000000000 -0700
+++ eglibc-2.19/README 2022-03-02 17:00:49.954759733 -0800
@@ -1,5 +1,7 @@
This directory contains the Embedded GNU C Library (EGLIBC).
+Add a line.
+
EGLIBC is a variant of the GNU C Library (GLIBC) that is designed to
work well on embedded systems. EGLIBC strives to be source and binary
compatible with GLIBC. EGLIBC's goals include reduced footprint,
PATCH
quilt import ../change-readme.diff -P any/change-readme.diff
quilt push
quilt import ../set-prefix.diff -P any/set-prefix.diff
quilt push
dpkg-buildpackage -us -uc -S -ai386下面是我看到的相关输出:
dpkg-source -b eglibc-2.19
dpkg-source: info: using options from eglibc-2.19/debian/source/options: --compression=xz
dpkg-source: info: using source format `3.0 (quilt)'
dpkg-source: info: building eglibc using existing ./eglibc_2.19.orig.tar.xz
patching file debian/rules
Reversed (or previously applied) patch detected! Skipping patch.
1 out of 1 hunk ignored
dpkg-source: info: fuzz is not allowed when applying patches
dpkg-source: info: if patch 'any/set-prefix.diff' is correctly applied by quilt, use 'quilt refresh' to update it
dpkg-source: error: LC_ALL=C patch -t -F 0 -N -p1 -u -V never -g0 -E -b -B .pc/any/set-prefix.diff/ --reject-file=- < eglibc-2.19.orig.yzNU0V/debian/patches/any/set-prefix.diff gave error exit status 1
dpkg-buildpackage: error: dpkg-source -b eglibc-2.19 gave error exit status 2注释掉用于quilt import和quilt push的set-prefix.diff命令将取得成功,但当然前缀没有像我想要的那样被更新。似乎修补程序多次被应用,这对于大多数文件来说都很好,但对debian/rules却不适用--也许这些补丁是应用在一个新的源目录上,但是debian/目录仍然是灵巧的吗?
建议使用什么方法构建带有自定义前缀的libc6,而不因重新应用修补程序而导致dpkg-buildpackage/dpkg-source失败?
发布于 2022-03-07 18:33:36
debian/rules目录是需要特殊引用的,不应该使用通常的quilt命令进行修补。您可以在构建包之前直接修改它们,或者使用patch命令(在本例中是patch -p1)。
https://stackoverflow.com/questions/71331029
复制相似问题