Differences between revisions 92 and 93
Revision 92 as of 2012-04-30 09:49:30
Size: 13145
Editor: GuoYixuan
Comment: remove a '#'
Revision 93 as of 2013-10-01 19:46:43
Size: 13295
Editor: AnthonyFok
Comment: Add link to http://raphaelhertzog.com/go/quilt which I find the most helpful and easiest to understand.
Deletions are marked like this. Additions are marked like this.
Line 123: Line 123:
 * the [[http://pkg-perl.alioth.debian.org/howto/quilt.html|Quilt for Debian Maintainers guide]] and
 * the [[http://www.debian.org/doc/manuals/maint-guide/index.en.html|Debian New Maintainers' Guide]].
 * the [[http://pkg-perl.alioth.debian.org/howto/quilt.html|Quilt for Debian Maintainers guide]],
 * the [[http://www.debian.org/doc/manuals/maint-guide/index.en.html|Debian New Maintainers' Guide]], and
 * Raphaël's very helpful article: [[http://raphaelhertzog.com/go/quilt|How to use quilt to manage patches in Debian packages]] (August 8, 2012).
Line 131: Line 132:
 * [[http://raphaelhertzog.com/2010/11/18/4-tips-to-maintain-a-3-0-quilt-debian-source-package-in-a-vcs/|Raphael's Article about maintainer 3.0 quilt packages in a VCS]] and  * [[http://raphaelhertzog.com/2010/11/18/4-tips-to-maintain-a-3-0-quilt-debian-source-package-in-a-vcs/|Raphaël's Article about maintainer 3.0 quilt packages in a VCS]] and

Summary

This page summarizes information concerning the switch to the new source package formats "3.0 (quilt)" and "3.0 (native)". This switch is planned to happen in the squeeze development cycle.

Advantages of new formats

  • Supports bzip2, lzma and xz along with the usual gzip.

    • Note: lzma is not allowed on ftp-master.debian.org.
  • Supports multiple upstream tarballs.
  • Supports inclusion of binary files (no need to uuencode a Debian specific PNG icon for example)
  • You don't have to repack the upstream tarball to strip the debian directory. (The debian directory is automatically replaced by the content of the  .debian.tar.{gz,bz2,lzma,xz}  file at unpack time)

  • Debian-specific changes are no longer stored in a single .diff.gz but in multiple patches in debian/patches/. It is compatible with quilt (hence its name) but does not require its usage as dpkg-source is able to do everything needed by itself. It applies patches at extraction time and update the patch series at build time.

  • NMU workflow is now really: unpack, hack, rebuild (for all 3.0 (quilt) packages).

Implementation

  • Lenny's dpkg has all the support for the new source formats. This is to avoid problems when working in Lenny with Squeeze source packages.
  • DAK (Debian Archive Kit) has been updated to cope with the new source package formats. See 457345 for history.

  • The plan to change the default source format has been dropped. Instead it is planned to make debian/source/format mandatory at some point and to not have any default format.

FAQ

How to convert a source package?

You need to put "3.0 (quilt)" or "3.0 (native)" in debian/source/format to indicate the desired format to dpkg-source (see dpkg-source(1) for more information):

mkdir debian/source ; echo '3.0 (quilt)' > debian/source/format ; dch 'Switch to dpkg-source 3.0 (quilt) format'

Native packages should not need any other change.

When you switch to "3.0 (quilt)", there are other changes that you might want to do:

  • If your .diff.gz modifies upstream files, you should really put those changes in separate quilt patches first, otherwise all those changes will be merged in a single quilt patch named debian/patches/debian-changes-<version>. Consider documenting those patches by following DEP-3.

  • If you use another patch system (dpatch, dbs, cdbs, etc.; with -p0, -p1, or p2), consider switching to the "3.0 (quilt)" format (see 581186 for a conversion helper script). (You can then simplify your debian/rules with "dh $@", see next point).

  • You should remove everything related to quilt in debian/rules (patch/unpatch logic, cleanup of quilt stamp file and its .pc directory).

Does a 3.0 (quilt) source package need to build-depend on quilt?

No because you're supposed to remove the quilt usage in debian/rules (patch/unpatch logic).

Is the README.source file needed with 3.0 (quilt) source packages?

No. Since dpkg-source -x applies the patch, you don't have to explain how the patch system works. If lintian gives you the patch-system-but-no-source-readme warning, upgrade to the latest version in sid.

How to use multiple upstream tarball in 3.0 (quilt) format?

Simply put a file  <source>_<version>.orig-<component>.tar.{gz,bz2,lzma,xz}  near the traditional  .orig  tarball. The content of that tarball should also be already unpacked in the  component  subdir of the unpacked source package. The next  dpkg-source -b  will pick it up automatically.

You can check this article as well: How to use multiple upstream tarballs in Debian source packages

Note: using a dash in the  component  requires dpkg >= 1.14.27, so you can't upload such packages until lenny's 4th point release (Debian 5.0.4).

Why should I convert my package to 3.0 (quilt) format?

Pick the reasons that matter to you:

  • by keeping patches separate and properly documented (with DEP-3):

    • the Debian changes are more likely to be reviewed (for example thanks to http://patch-tracker.debian.org)

    • any upstream contributor is more likely to find and merge the patches (if you haven't forwarded it properly)
    • other distributions can reuse our patches
  • even if you don't have any upstream patch right now, next time that someone must NMU your package, they can cleanly add a patch (with a proper DEP-3 header) without having to modify the build system
  • same applies for derivative distributions that have to modify your packages... you're more likely to be able to find something valuable to merge if their changes are kept as separate patches instead of merged within the .diff.gz
  • debian/rules can be simplified by getting rid of the patching/unpatching code (or the uuencoding/uudecoding code if you ship a supplementary binary file like an icon)
  • the upstream tarball is bzip2-compressed and you don't want to have to convert it
  • the upstream tarball contains a debian directory and you don't want to repackage it just to remove that directory
  • the upstream author releases the software in multiple tarballs
  • you don't have to add -i -I every time that you manually build the package from the VCS repository (the VCS-specific files are ignored by default)
  • in the long run it's best to standardize on a single patch system (new contributors need to learn a single system, more people can help you, etc.) and quilt appears to be that patch system.

Will my packages be backportable to etch?

With 3.0 (quilt), backporting to etch is possible if you don't use multiple upstream tarballs.

If this is the case, you can trivially backport by doing the following:

  • unpack the source package with a recent dpkg-source (lenny or newer)
  • convert any .orig.tar.bz2 into .orig.tar.gz (bzcat .orig.tar.bz2 | gzip > .orig.tar.gz)

  • remove debian/source/format (or put "1.0" in it)
  • do any other usual backporting (tweaking build-dependencies, etc.)
  • rebuild (on an etch system) with dpkg-buildpackage -i.pc to avoid including the internal directory

The changes coming from the quilt patches will be in the .diff.gz but it will work.

I get lintian errors and warnings with new source formats

The following warnings are incorrect for the new Debian source formats, and are fixed in the latest Lintian:

  • patch-system-but-no-source-readme is wrong (see 553207)

  • unsupported-source-format 3.0 (quilt/native) is wrong (see 552707)

You should always use the latest Lintian version from Sid to test your packages.

I converted my package but it fails to build or fails to unpack on all buildds

If you get a failure like:

dpkg-source: info: applying XXXX
1 out of 1 hunk FAILED -- saving rejects to file xxx.rej

You probably have quilt patches that only applies with fuzz (i.e. they only apply if patch ignores context lines). quilt applies those without failing but dpkg-source doesn't. The solution is to refresh the patches, for example with those commands :

quilt pop -a
while quilt push; do quilt refresh -p ab; done

dpkg-dev 1.15.5.3 and later prevent you from building source packages with such patches.

Why aren't -p0 patch supported in 3.0 (quilt) format?

See sub-thread starting here.

How many packages have already been converted?

http://upsilon.cc/~zack/stuff/dpkg-v3/

But, how do I actually work with the 3.0 (quilt) format?

To actually take advantage of this new format, see

They explain how to add and edit patches and integrate things in your workflow.

Are there more docs?

Try:

How to convert back to 1.0?

We have no idea why you should want this, but DpkgV3toV1 has the instructions from the old backports.org site.

Validation of all tools with new source formats

For all applications, please be sure to test the 3 important cases:

  • 3.0 (native)
  • 3.0 (quilt)
  • 3.0 (quilt) with multiple upstream tarballs

It's also interesting to test with various compressions methods (gz, bz2, lzma, xz).

Some sample source packages are available here. You can add it to /etc/apt/sources.list with deb-src http://people.debian.org/~hertzog/packages/ debsrc3.0/. They have the following characteristics:

  • sample1: 3.0 (quilt) with orig.tar.gz / debian.tar.gz and additional tarballs with all compressions schemes
  • sample2: 3.0 (quilt) with orig.tar.bz2 / debian.tar.bz2
  • sample3: 3.0 (quilt) with orig.tar.lzma / debian.tar.lzma
  • sample4: 3.0 (native) with tar.gz
  • sample5: 3.0 (native) with tar.bz2
  • sample6: 3.0 (native) with tar.lzma

Current test results:

  • lintian
    • Works (full support in 2.5.2)
  • apt-get source
    • Works.
  • dput
    • Works.
  • sbuild (in Debian sid)
  • svn-buildpackage
    • Works except with multiple upstream tarballs (577140).

    • Can not use xz-compressed upstream tarballs (388567).

  • bzr-builddeb
    • According to changelog for bzr-builddeb version 2.4:
    • Some support for v3 source formats (Closes: 562991)

      • Those that look quite a lot like v1 are supported well.
      • .tar.bz2 tarballs are supported for import, building, merge-upstream,
        • etc., but only enabled for the latter with a --v3 switch for now.
      • Multiple orig.tar.gz is not supported.
      • .tar.lzma is not supported awaiting pristine-tar support.

      Testing is still needed for more complex use cases.

  • git-buildpackage
    • git-buildpackage; works for building 3.0 (native) and 3.0 (quilt) packages
    • git-import-dsc: needs to learn about new source format.
    • git-import-orig: needs to learn about multiple tarballs and lzma.
  • mercurial-buildpackage
    • Works.
  • tla-buildpackage
    • Not working yet: 557333

    • Not tested yet for 3.0 (native), different compression methods and muiltiple tarballs.
  • dupload
    • Works.
  • pbuilder/cowbuilder
    • Works.
  • approx
    • Works.
  • reprepro
  • reprepro's changestool
    • works, but extracing Section and priority from .debian.lzma only since 3.9.0
  • debmirror
    • Not tested yet (but should work as it works based on file names).

  • devscripts uscan and uupdate
    • Wishlist: handle multiple upstream tarballs. 531321

  • devscripts uupdate
    • Wishlist: message to point to debian.tar.gz not just diffs. 575820

  • devscripts debdiff
    • Wishlist: handle debian.tar.gz diff. 575821

  • other devscripts tools ?
    • A new debreview tool would be welcome to replace zless *.diff.gz: 575394

  • devscripts dquilt
    • Wishlist: wrapper for quilt. 624556

  • mini-dinstall
    • Fails to push .orig.tar.bz2 and other source files to repository: 571226

  • DEHS
    • Works.
  • Launchpad/Soyuz (Ubuntu and PPAs):
  • http://patch-tracker.debian.org/

  • apt-cacher-ng
    • support added in version 0.4.3-1
  • http://packages.debian.org

    • Patch Tracker link missing for 3.0 (quilt) src packages: 560882

  • Impact on PTS: http://packages.qa.debian.org/ ?

  • What else should we check ?

Please try using new source packages with all your usual tools (in particular if you maintain them) and file bugs if you encounter problems and usertag them appropriately (user hertzog@debian.org / tag 3.0-quilt-by-default). Also update the list above with any relevant information (including pointers to bugs).


CategorySpec CategoryDebianDevelopment