章 9. 上傳套件

內容目錄

9.1. 上傳到 Debian 倉庫
9.2. 在上傳時包含 orig.tar.gz 檔案
9.3. 跳過的上傳

Now that you have tested your new package thoroughly, you want to release it to a public archive to share it.

9.1. 上傳到 Debian 倉庫

Once you become an official developer, [84] you can upload the package to the Debian archive. [85] You can do this manually, but it's easier to use the existing automated tools, like dupload(1) or dput(1). We'll describe how it's done with dupload. [86]

首先需要設置 dupload 的設定檔案。你既可以編輯系統級的 /etc/dupload.conf 檔案,也可以使用自己的 ~/.dupload.conf 檔案覆蓋一些需要修改的設置。

你可以閱讀 dupload.conf(5) man 手冊頁來了解各選項的含義。

The $default_host option determines which of the upload queues will be used by default. anonymous-ftp-master is the primary one, but it's possible that you will want to use another one. [87]

While connected to the Internet, you can upload your package as follows:

$ dupload gentoo_0.9.12-1_i386.changes

dupload checks that the SHA1/SHA256 file checksums match those listed in the .changes file. If they do not match, it will warn you to rebuild it as described in 節 6.1, “完整的(重)構建” so it can be properly uploaded.

If you encounter an upload problem at ftp://ftp.upload.debian.org/pub/UploadQueue/, you can fix this by manually uploading a GPG-signed *.commands file to there with ftp. [88] For example, using hello.commands:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Uploader: Foo Bar <Foo.Bar@example.org>
Commands: 
 rm hello_1.0-1_i386.deb
 mv hello_1.0-1.dsx hello_1.0-1.dsc
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

[...]
-----END PGP SIGNATURE-----

9.2. 在上傳時包含 orig.tar.gz 檔案

When you first upload the package to the archive, you need to include the original orig.tar.gz source, too. If the Debian revision number of this package is neither 1 nor 0, you must provide the dpkg-buildpackage option -sa.

For the dpkg-buildpackage command:

$ dpkg-buildpackage -sa

For the debuild command:

$ debuild -sa

For the pdebuild command:

$ pdebuild --debbuildopts -sa

On the other hand, the -sd option will force the exclusion of the original orig.tar.gz source.

9.3. 跳過的上傳

If you created multiple entries in debian/changelog by skipping uploads, you must create a proper *_.changes file which includes all changes from the last upload. This can be done by specifying the dpkg-buildpackage option -v with the version, e.g., 1.2.

For the dpkg-buildpackage command:

$ dpkg-buildpackage -v1.2

For the debuild command:

$ debuild -v1.2

For the pdebuild command:

$ pdebuild --debbuildopts "-v1.2"


[85] There are publicly accessible archives such as http://mentors.debian.net/ which work almost the same way as the Debian archive and provide an upload area for non-DDs. You can set up an equivalent archive by yourself using the tools listed at http://wiki.debian.org/HowToSetupADebianRepository. So this section is useful for non-DDs, too.

[86] The dput package seems to come with more features and to be becoming more popular than the dupload package. It uses the file /etc/dput for its global configuration and the file ~/.dput.cf for per-user configuration. It supports Ubuntu-related services out-of-the-box, too.

[88] See ftp://ftp.upload.debian.org/pub/UploadQueue/README. Alternatively, you can use the dcut command from the dput package.