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'” . |