Глава 13. Tool usages

# Глава 13. Tool usages

Here are some notable tools around Debian packaging.

| Примечание
The descriptions in this section are intentionally brief. Prospective maintainers are strongly encouraged to search for and read all relevant documentation associated with these commands.

| Примечание
Examples here use the gz-compression. The xz-compression may be used instead.

## 13.1. debdiff

Можно сравнивать содержимое файлов в двух пакетах Debian с исходным кодом с помощью команды debdiff.

    [base_dir] $ debdiff old-package.dsc new-package.dsc

Также можно сравнивать списки файлов в двух наборах двоичных пакетов Debian с помощью команды debdiff.

    [base_dir] $ debdiff old-package.changes new-package.changes

Это полезно для определения изменений в пакетах с исходным кодом и для проверки на предмет нечаянных изменений, привнесённых при обновлении двоичных пакетов, таких как непреднамеренное ошибочное размещение или удаление файлов.

Debian now enforces the source-only upload when developing packages. So there may be 2 different *.changes files:

- package_version-revision_source.changes for the normal source-only upload
- package_version-revision_arch.changes for the source+binary upload

## 13.2. dget

Можно скачать набор файлв для пакета Debian с исходным кодом с помощью команды dget.

    [base_dir] $ dget https://www.example.org/path/to/package_version-rev.dsc

## 13.3. mk-origtargz

You can make the upstream tarball ../foo-newversion.tar.[xg]z accessible from the Debian source tree as ../foo_newversion.orig.tar.[xg]z. This command is useful for renaming and symlinking the upstream tarball to the expected Debian naming convention.

## 13.4. origtargz

You can fetch the pre-existing orig tarball of a Debian package from various sources, and unpack it with origtargz command.

This is basically for -2, -3, …​ revisions.

| Примечание
When the upstream tarball is missing, debmake automatically produces a required tarball. This is a convenient feature and good enough for making a private Debian package. But when making a Debian package for the official Debian repository, you must use exactly the same upstream tarball as the -1 revision. For such case, origtargz should be used.

## 13.5. git deborig

If the upstream project is hosted in a Git repository without an official tarball release, you can generate its orig tarball from the git repository for use by the Debian source package. Execute «git deborig» from the root of the checked-out source tree.

This is basically for -1 revisions.

## 13.6. dpkg-source -b

The «dpkg-source -b» command packs the upstream source tree into the Debian source package.

It expects a series of patches in the debian/patches/ directory and their application sequence in debian/patches/series.

It is compatible with dquilt (see «Раздел 4.4, «quilt setup»») operations and understands the patch application status from the existence of .pc/applied-patches.

The dpkg-buildpackage command invokes «dpkg-source -b».

## 13.7. dpkg-source -x

The «dpkg-source -x» command extracts the source tree and applies the patches in the debian/patches/ directory using the sequence specified in debian/patches/series to the upstream source tree. It also adds .pc/applied-patches. (See «Раздел 11.13, «Patch applied Git repository»».)

The «dpkg-source -x --skip-patches» command extracts source tree only. It doesn’t add .pc/applied-patches. (See «Раздел 11.5, «Patch unapplied Git repository»».)

Both extracted source trees are ready for building Debian binary packages with dpkg-buildpackage, dbuild, sbuild, etc..

## 13.8. debc

Созданные пакеты следуется установить с помощью команды debc для их локальной проверки.

    [base_dir] $ debc package_version-rev_arch.changes

## 13.9. bts

After uploading the package, you will receive bug reports. It is an important duty of a package maintainer to manage these bugs properly, as described in «5.8. Handling bugs» of the «Debian Developer’s Reference».

The bts command is a handy tool to manage bugs on the «Debian Bug Tracking System».

    [~] $ bts severity 123123 wishlist , tags -1 pending

## 13.10. dpkg-depcheck

You can use dpkg-depcheck(1) to obtain a good first approximation to the Build-Depends line needed by a Debian package.

    [foo-1.0] $ dpkg-depcheck -b debian/rules build

Глава 12. Полезные советы |  | Глава 14. Дополнительные примеры