gpt4 book ai didi

linux - Debian 软件包创建错误

转载 作者:太空宇宙 更新时间:2023-11-04 11:42:23 24 4
gpt4 key购买 nike

我正在尝试构建一个 Debian 软件包,但我遇到了这个奇怪的伪目录问题。我跑:

$ fakeroot debian/rules binary

我以前构建过二进制文件,但我的系统上一定发生了一些变化。现在 dh_md5sums 出错并返回:

md5sum: include: Is a directory
dh_md5sums: command returned error code
make: *** [binary-arch] Error 1

的确,include是一个目录。因此,我向 dh_md5sums 添加了一些调试语句,以找出为什么 include 被散列,尽管该行应该过滤掉目录。添加:

doit("ls", "-l", "$tmp");

表明,当 dh_md5sums 运行时,include 确实不是一个目录:

total 28
drwxr-xr-x 2 root root 4096 2009-06-18 13:36 bin
-rwxr-xr-x 3 root root 4096 2009-06-18 13:36 include
drwxr-xr-x 3 root root 4096 2009-06-18 13:36 var
# some directories removed for brevity's sake

那么,我可以删除它吗?我补充说:

doit("rm", "$tmp/include");

得到:

rm: cannot remove `debian/myproject/include': Is a directory

也许它...变成了一个目录?我在 rm 下面添加了另一个 ls -l 并得到:

total 28
drwxr-xr-x 2 root root 4096 2009-06-18 13:36 bin
-rwxr-xr-x 3 root root 4096 2009-06-18 13:36 include
drwxr-xr-x 3 root root 4096 2009-06-18 13:36 var

当脚本运行完毕后,我可以:

$ ls -l
drwxr-xr-x 2 x x 4096 2009-06-18 13:48 bin
drwxr-xr-x 3 x x 4096 2009-06-18 13:48 include
drwxr-xr-x 3 x x 4096 2009-06-18 13:48 var

...这很奇怪,因为 include 变成了一个目录并且所有权发生了变化(x 是我的用户名)。 include 甚至包含它应该包含的所有头文件。

有人知道这是怎么回事吗?

最佳答案

total 28
drwxr-xr-x 2 root root 4096 2009-06-18 13:36 bin
-rwxr-xr-x 3 root root 4096 2009-06-18 13:36 include
drwxr-xr-x 3 root root 4096 2009-06-18 13:36 var
# some directories removed for brevity's sake

请注意,include 的链接数为 3,表示它是一个包含 1 个子目录的目录,或者是一个包含 3 个硬链接(hard link)的文件。前者似乎更有可能。

这似乎是与 fakeroot 的不良交互。我以前见过 fakeroot 有时会“忘记”权限,因此请仔细检查 include 被创建或修改时是否具有正确的类型(并且这些都没有最近的更改)。

关于linux - Debian 软件包创建错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1014301/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com