24.5. 同步原始碼

有幾種不同的方法保持 FreeBSD 原始碼在最新狀態。 這節比較這兩個主要的方法: SubversionCTM

警告:

雖然有可能只更新部份原始碼樹,但是唯一支援的更新步驟是更新整個樹併重新編譯所有在使用者空間的程式, 例如在/bin/sbin,以及核心原始碼。 只更新部份原始碼樹,只更新核心,或只更新使用者空間的程式時常會導致編譯錯誤,核心錯誤或是資料惡化等問題。

Subversion使用更新原始碼的 pull 模型。使用者,或是 cron 手稿語言, 呼叫更新本地端原始碼的 svn 程式。 Subversion is the preferred method for updating local source trees as updates are up-to-the-minute and the user controls when updates are downloaded. It is easy to restrict updates to specific files or directories and the requested updates are generated on the fly by the server. 如何使用How to synchronize source using Subversion同步原始碼,描述於節 A.4, “Using Subversion

CTM does not interactively compare the local sources with those on the master archive or otherwise pull them across. Instead, a script which identifies changes in files since its previous run is executed several times a day on the master CTM machine. Any detected changes are compressed, stamped with a sequence-number, and encoded for transmission over email in printable ASCII only. Once downloaded, these deltas can be run through ctm.rmail which will automatically decode, verify, and apply the changes to the user's copy of the sources. This process is more efficient than Subversion and places less strain on server resources since it is a push, rather than a pull, model. Instructions for using CTM to synchronize source can be found at 節 A.3, “Using CTM”.

If a user inadvertently wipes out portions of the local archive, Subversion will detect and rebuild the damaged portions. CTM will not, and if a user deletes some portion of the source tree and does not have a backup, they will have to start from scratch from the most recent base delta and rebuild it all with CTM.

本文及其他文件,可由此下載: ftp://ftp.FreeBSD.org/pub/FreeBSD/doc/

若有 FreeBSD 方面疑問,請先閱讀 FreeBSD 相關文件,如不能解決的話,再洽詢 <questions@FreeBSD.org>。

關於本文件的問題,請洽詢 <doc@FreeBSD.org>。