[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

debootstrap and debian-ports

Looking on the web for a recommended way of using debootstrap 
with debian-ports, I couldn't find a definitive answer. 
Here are my findings - may it help ? 
Perhaps someone wiser could comment and shed some light 
on the matter ?

debootstrap and debian ports

Recently (or not) the question arose on the mailing list :

The install from debian-ports comes with two hurdles :
1/ Packages from both "suite" unstable and unreleased are needed
(by contrast, a normal install pulls packages from one sole suite
chosen among oldstable, stable or unstable)
2/ There are often missing, yet to build dependencies absent of the

Let's concentrate on 1/

debian-ports hosts packages for unofficial architectures until they 
are integrated in the main Debian archive. There are 3 suites : 
unstable, unreleased and experimental, and in each one component : main 
(one have to download non-free firmwares from the main Debian archive).
>From the description on http://www.debian-ports.org :

"The unreleased suite : this suite is used to upload packages 
which need hacks to build until the changes are integrated into Debian."

In an ideal world, the changes would be included in the next upstream version 
of the package. And this new version entering into unstable would replace 
the hacked one in unreleased. 
In the real world, it is often necessary to keep different versions in the 
archive (think of the toolchain). This results in several versions of 
one package spread among unstable and unreleased. libstdc++6 is the most 
prominent example : one for each gcc-${version} source package.

>From these versions, debootstrap should install the newest one.

debootstrap and multiple versions

debootstrap is designed to download and parse the Packages file from one
sole suite (the Packages file contains stanzas describing each a version of
a package in the suite).

The names of all packages of priority required, of 
priority important (unless told otherwise) and their dependencies
(unless told otherwise) are collected.
(function work_out_debs, line 18 of /usr/share/debootstrap/scripts/unstable,
in debootstrap version 1.0.55)

For each name, the version selected for installation is the one in the last 
stanza of the first consecutive sequence of stanzas of this package name.
(function download_debs, line 623 of /usr/share/debootstrap/functions,
function pkgdetails_perl, lines 1095, 1180 and 1186 of /usr/share/debootstrap/functions,
in debootstrap version 1.0.55)
This amounts to choose the newest version iff the Packages file is sorted,
i.e. all stanzas of a given package name are grouped together, and this group is
sorted by ascending version number.

Some order in Packages files

The program mini-dak at work at debian-ports currently assembles a 
Packages file with "Architecture: all" packages first, 
and then the ones of the given architecture. 
apt-sortpkgs (of package "apt-utils") sorts separately each 
of these groups. However, it is a mere lexical sort on package name
and then on version string to break tie. Epochs and version comparison 
rules are not taken into account.
(line 50 of cmdline/apt-sortpkgs.cc
line 604 of apt-pkg/contrib/strutl.cc
in apt version
(line 39 of archive-reindex-meta in mini-dak)

Some packages (e.g. sensible-utils 0.0.0 and 0.0.9 on m68k, iproute 20120521-3 and 
1:3.12.0-1 everywhere) have moved from one architecture to "Architecture: all" 
in newer versions (or conversely) - both versions are present in the 
("debootstrap --no-resolve-deps" actually ends up in a fatal error :
"sensible-utils" is counted twice when collecting the names, once when
selecting the version to install. Is it a bug in debootstrap ? 
This isn't a common use case though)

A solution (?)

I would suggest to modify debootstrap to download Packages files from both unstable 
and unreleased, to concatenate them and to sort by package name and by 
ascending version number. 

Some previous (unsuccesful) thoughts

See also http://bugs.debian.org/690210

- Give precedence to packages in unreleased (or in unstable either) : this is 
wrong if a newer version exists in the other suite. It depends on the history 
of package changes (e.g. libstdc++6 on alpha and m68k).

- Replace selected versions from unstable by newer versions from unreleased
if available : it doesn't address the architecture <-> all problem.

- Concatenate Packages files from unstable and unreleased and sort through 
apt-sortpkgs : it fails in case of epochs in version number (e.g. iproute recently).

Thanks to Michael Cree, Aurélien Jarno, Laurent Vivier and Thorsten Glaser for
useful advice, corrections and testing related to bug #690210.

J.-H. Chatenet

PS : please CC me : I am not on the list

Reply to: