splitout_tdeb

Langue: en

Version: 2009-03-29 (debian - 07/07/09)

Section: 1 (Commandes utilisateur)

NAME

splitout_tdeb - splits out a Debian TDeb from a .deb on-the-fly

Description

Splits a Debian package into a Debian TDeb and a smaller Debian package by unpacking, moving relevant files and repacking with a note in the description and the +t1 version suffix.

When creating a repository containing TDebs, it is strongly recommended to specify .changes files so that the repository can include the original sources, for legal reasons.

If a file exists with the same name in the output directory, it will be overwritten.

  Copyright (C) 1997-2000  Roman Hodek <roman@hodek.net>
  Copyright (C) 2000-2002  Colin Watson <cjwatson@debian.org>
  Copyright (C) 2002-2004  David Schleef <ds@schleef.org>
  Copyright (C) 2004  Nikita Youshchenko <yoush@cs.msu.su>
  Copyright (C) 2004  Raphael Bossek <bossekr@debian.org>
  Copyright (C) 2007-2008  Neil Williams <codehelp@debian.org>
 
  This package is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 3 of the License, or
  (at your option) any later version.
 
  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.
 
  You should have received a copy of the GNU General Public License
  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 

Converting to TDebs

The idea here is based on dpkg-cross:
  1. receive .deb or .changes as a command-line option
  2. unpack the .deb as dpkg-cross does
  3. create control data for the new TDeb
  4. relocate files into the TDeb
  5. repack the .deb with a TDeb version suffix.
  6. rebuild the original .deb and revise .changes so that the
      original source can be retained.
 
 

As few dependencies as possible - this script should be transformed into more usable TDeb support.

Future versions will also have to understand Dpkg Classes but until those are implemented, this uses brute force.

Automation

Relatively simple, but a few checks are needed in case your list of possible packages includes packages already processed by dpkg-cross.
  #!/bin/sh
  set -e
 
  DIR=/tmp/myrepo/
  for deb in `ls /var/cache/apt/archives/*.deb`; do
     cross=`echo $deb | grep "\-.*-cross" || true`
     if [ ! -z "$cross" ]; then
         echo "skipping dpkg-cross package: $deb"
         continue
     fi
     /usr/share/emdebian-tools/splitout_tdeb -o $DIR $deb
  done
 
 

A similar script should be able to cope with obtaining .changes files to retain the source packages.

Despite using dcut internally, splitout_tdeb isn't set up to obtain the .changes files directly from http://incoming.debian.org, a wrapper script would be needed.

An additional wrapper is likely to be needed to allow a TDeb repository to ``catch-up'' with the existing Debian mirrors, e.g. if the first upload to the TDeb repository is a binary-only upload without a referenced .orig.tar.gz. See emdebian-grip for how this could work.

splitout_tdeb does ensure that the .tar.gz is copied into the output directory and reprepro can locate the relevant files if the --ignore=missingfile option is passed. Sadly, this functionality is not preserved in the reprepro processincoming mode.

Problems

Many. :-)

Needs more work, probably to allow (or make default) the option *not* to rebuild the binary package but that depends on the binary already supporting a TDeb. Right now, this is a quick hack to get some TDebs easily. splitout_tdeb probably does not deserve to go into a stable release, the support should be implemented directly within the Debian builds.

The TDeb generated uses the source package name which will complicate things if you try to generate TDebs from binaries belonging to the same source package - use dpkg-gentdeb or dh_gentdeb from within the (native) package build instead.

Also, strict dependencies are not altered by splitout_tdeb - if another package (typically from the same source package) has a strict dependency on a package rebuilt by splitout_tdeb, that package is likely to become uninstallable. i.e. if foo depends on bar (= 1.2.3-4) and bar is rebuilt by splitout_deb, bar will become 1.2.3-4+t1 and foo will be uninstallable. As above, the solution is to prepare the TDeb from within the normal package build. emdebian-grip has also solved this problem but splitout_tdeb is only a convenience script and does not (yet) use this support.

Use the --verbose option to see the generated control file content of the TDeb and the modified binary package.

splitout_tdeb also does not (yet) support +t2 or other revisions of the TDeb - this needs support in dpkg for .diff1.gz so that the +t2 can be uploaded without affecting the binary package(s). The entire mechanism for how translators will update TDebs is yet to be implemented.