Debian 包创建错误

发布于 2024-07-24 05:38:26 字数 1545 浏览 10 评论 0原文

我正在尝试构建 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 甚至包含它应该包含的所有头文件。

有谁知道发生了什么事吗?

I'm trying to build a Debian package, but I've got this weird pseudo-directory problem. I run:

$ fakeroot debian/rules binary

I've built the binary before, but something must have changed on my system. Now dh_md5sums errors out and returns:

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

Indeed, include is a directory. So, I added some debugging statements to dh_md5sums, to figure out why include was being hashed despite the line that was supposed to filter out directories. Adding:

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

shows that, indeed, include is not a directory when dh_md5sums is run:

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

So, can I remove it? I added:

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

and got:

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

maybe it... turned into a directory? I added another ls -l below the rm and got:

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

and when the scripts are done running, I can do:

$ 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

...which is weird, as include becomes a directory and the ownership changes (x is my username). include even contains all the header files it's supposed to.

Does anyone know what's going on?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

扎心 2024-07-31 05:38:26
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 个硬链接的文件。 前者的可能性似乎更大。

这似乎是与 fakeroot 的不良交互。 我以前见过 fakeroot 有时会“忘记”权限,因此请仔细检查在创建或修改 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

Note that include has a link count of 3, indicating that it's either a directory with 1 subdirectory, or a file with 3 hard links. The former seems more likely.

This seems like a bad interaction with fakeroot. I've seen it before where fakeroot sometimes "forgets" permissions, so double check that when include is being created or modified that it has the right type (and that none of these have recent changes).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文