Please also read insightful pages linked from “Notes on Debian” by Russ Allbery (long time Debian developer) which have best practices for advanced packaging topics.
构建环境的默认语言环境是 C。
某些程序(如 Python3 的 read 函数)会根据区域设置改变行为。
添加以下代码到 debian/rules 文件可以确保程序使用 C.UTF-8 的区域语言设置(locale)进行构建。
LC_ALL := C.UTF-8 export LC_ALL
If upstream documents are encoded in old encoding schemes, converting them to UTF-8 is a good idea.
Use the iconv command in the libc-bin package to convert the encoding of plain text files.
$ iconv -f latin1 -t utf8 foo_in.txt > foo_out.txt
使用 w3m(1) 将 HTML 文件转换为 UTF-8 纯文本文件。 执行此操作时,请确保在 UTF-8 语言环境下执行它。
$ LC_ALL=C.UTF-8 w3m -o display_charset=UTF-8 \ -cols 70 -dump -no-graph -T text/html \ < foo_in.html > foo_out.txt
在 debian/rules 文件的 override_dh_* 目标中运行这些脚本。
当您遇到构建问题或者生成的二进制程序核心转储时,您需要自行解决他们。这就是除错(debug)。
This is too deep a topic to describe here. So, let me just list few pointers and hints for some typical debug tools.
Wikipedia: “core dump”
Update the “/etc/security/limits.conf” file to include the following:
* soft core unlimited
gdb - The GNU Debugger
strace - 跟踪系统调用和信号
ltrace - 跟踪库调用
“perl -d:Trace script.pl” - Trace a Perl script
lsof - 按进程列出打开的文件
![]() | 提示 |
---|---|
script 命令能帮助记录控制台输出。 |
![]() | 提示 |
---|---|
在 ssh 命令中搭配使用 screen 和 tmux 命令,能够提供安全并且强健的远程连接终端。 |
![]() | 提示 |
---|---|
libreply-perl(新的)软件包和来自 libdevel-repl-perl(旧的)软件包的 re.pl 命令为 Perl 提供了一个类似 Python 和 Shell 的 REPL (=READ + EVAL + PRINT + LOOP) 环境。 |
![]() | 提示 |
---|---|
The rlwrap and rlfe commands add input line editing capability with history support to any interactive commands. E.g. “rlwrap dash -i'” . |