Download Debian New Maintainers` Guide
Transcript
Debian New Maintainers’ Guide 5.24 37 / 58 source/local-options When you want to manage Debian packaging activities under a VCS, you typically create one branch (e.g. upstream) tracking the upstream source and another branch (e.g. typically master for Git) tracking the Debian package. For the latter, you usually want to have unpatched upstream source with your debian/* files for the Debian packaging to ease merging of the new upstream source. After you build a package, the source is normally left patched. You need to unpatch it manually by running dquilt pop -a before committing to the master branch. You can automate this by adding the optional debian/source/local-options file containing unapply-patches. This file is not included in the generated source package and changes the local build behavior only. This file may contain abort-on-upstream-changes, too (see dpkg-source(1)). unapply-patches abort-on-upstream-changes 5.25 source/options The autogenerated files in the source tree can be quite annoying for packaging since they generate meaningless large patch files. There are custom modules such as dh_autoreconf to ease this problem as described in Section 4.4.3. You can provide a Perl regular expression to the --extend-diff-ignore option argument of dpkg-source(1) to ignore changes made to the autogenerated files while creating the source package. As a general solution to address this problem of the autogenerated files, you can store such a dpkg-source option argument in the source/options file of the source package. The following will skip creating patch files for config.sub, config. guess, and Makefile. extend-diff-ignore = ”(^|/)(config\.sub|config\.guess|Makefile)$” 5.26 patches/* The old 1.0 source format created a single large diff.gz file containing package maintenance files in debian and patch files for the source. Such a package is a bit cumbersome to inspect and understand for each source tree modification later. This is not so nice. The newer 3.0 (quilt) source format stores patches in debian/patches/* files using the quilt command. These patches and other package data which are all contained under the debian directory are packaged as the debian.tar.gz file. Since the dpkg-source command can handle quilt formatted patch data in the 3.0 (quilt) source without the quilt package, it does not need a Build-Depends on quilt. 9 The quilt command is explained in quilt(1). It records modifications to the source as a stack of -p1 patch files in the debian/ patches directory and the source tree is untouched outside of the debian directory. The order of these patches is recorded in the debian/patches/series file. You can apply (=push), un-apply (=pop), and refresh patches easily. 10 For Chapter 3, we created three patches in debian/patches. Since Debian patches are located in debian/patches, please make sure to set up the dquilt command properly as described in Section 3.1. When anyone (including yourself) provides a patch foo.patch to the source later, modifying a 3.0 (quilt) source package is quite simple: 9 Several methods of patch set maintenance have been proposed and are in use for Debian packages. The quilt system is the preferred maintenance system in use. Others include dpatch, dbs, and cdbs. Many of these keep such patches as debian/patches/* files. 10 If you are asking a sponsor to upload your package, this kind of clear separation and documentation of your changes is very important to expedite the package review by your sponsor.