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

Bug#773281: apt does not resolve equal (=) dependencies correctly



Package: apt
Version: 1.0.9.4
Severity: important

Hi,

the following bug is a major burden when working with Debian repositories that
contain multiple versions of one package. Image following example:

You have two packages named A and B. A in version 1 depends on B in version 1.
Apt will automatically install B=1 when you install A=1.

Now assume you have A available in version 1 and 2 and B in version 1 and 2. If
A and B are currently not installed, apt will try to install B=2 when you want
to install A=1. This fails of cause because of the package dependencies. This is
probably a bug in apt as it sees version 2 for B as the best install candidate
even if the dependency says different.

Steps to reproduce:
===============================================================================
#!/bin/sh
set -e

mkdir /tmp/alpha-1.0 && cd /tmp/alpha-1.0
dh_make -c mit -s -n -p alpha_1.0 -y
sed -i 's/^Depends: /Depends: beta (= ${binary:Version})/' debian/control
debuild -b
dch -v 2.0 'Bump version'
cd ../alpha-2.0
debuild -b

mkdir /tmp/beta-1.0 && cd /tmp/beta-1.0
dh_make -c mit -s -n -p beta_1.0 -y
debuild -b
dch -v 2.0 'Bump version'
cd ../beta-2.0
debuild -b

cd /tmp
apt-ftparchive packages . | gzip > Packages.gz
echo "deb file:///tmp/ ./" >> /etc/apt/sources.list
apt-get update
apt-get install alpha=1.0
===============================================================================

Apt throws following error message instead of installing alpha=1.0 and beta=1.0:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 alpha : Depends: beta (= 1.0) but 2.0 is to be installed
E: Unable to correct problems, you have held broken packages.

-- 
Benjamin Drung
System Developer

ProfitBricks GmbH - The IaaS-Company
Greifswalder Str. 207
D - 10405 Berlin

Mail: benjamin.drung@profitbricks.com
Fax:  +49 30 577 008 598
URL:  http://www.profitbricks.com

Sitz der Gesellschaft: Berlin.
Registergericht: Amtsgericht Charlottenburg, HRB 125506 B.
Geschäftsführer: Andreas Gauger, Achim Weiss.


Reply to: