Debian包创建错误

时间:2009-06-18 18:13:19

标签: linux debian packaging dpkg

我正在尝试构建一个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

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

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甚至包含它应该包含的所有头文件。

有谁知道发生了什么事?

1 个答案:

答案 0 :(得分:1)

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时检查它是否具有正确的类型(并且这些都没有最近的更改)。

相关问题