Browse Source

* apt-pkg/packagemanager.cc:

- ensure for Multi-Arch:same packages that they are unpacked in
    lock step even in immediate configuration (Closes: #618288)
tags/debian/0.8.15
David Kalnischkies 10 years ago
parent
commit
d77b985a30
4 changed files with 75 additions and 8 deletions
  1. +37
    -7
      apt-pkg/packagemanager.cc
  2. +2
    -0
      apt-pkg/packagemanager.h
  3. +4
    -1
      debian/changelog
  4. +32
    -0
      test/integration/test-bug-618288-multiarch-same-lockstep

+ 37
- 7
apt-pkg/packagemanager.cc View File

@@ -319,6 +319,17 @@ bool pkgPackageManager::SmartConfigure(PkgIterator Pkg)
List->Flag(Pkg,pkgOrderList::Configured,pkgOrderList::States);
}

if (Cache[Pkg].InstVerIter(Cache)->MultiArch == pkgCache::Version::Same)
for (PkgIterator P = Pkg.Group().PackageList();
P.end() == false; P = Pkg.Group().NextPkg(P))
{
if (Pkg == P || List->IsFlag(P,pkgOrderList::Configured) == true ||
Cache[P].InstallVer == 0 || (P.CurrentVer() == Cache[P].InstallVer &&
(Cache[Pkg].iFlags & pkgDepCache::ReInstall) != pkgDepCache::ReInstall))
continue;
SmartConfigure(P);
}

// Sanity Check
if (List->IsFlag(Pkg,pkgOrderList::Configured) == false)
return _error->Error(_("Could not perform immediate configuration on '%s'. "
@@ -474,22 +485,29 @@ bool pkgPackageManager::SmartRemove(PkgIterator Pkg)
// ---------------------------------------------------------------------
/* This performs the task of handling pre-depends. */
bool pkgPackageManager::SmartUnPack(PkgIterator Pkg)
{
return SmartUnPack(Pkg, true);
}
bool pkgPackageManager::SmartUnPack(PkgIterator Pkg, bool const Immediate)
{
// Check if it is already unpacked
if (Pkg.State() == pkgCache::PkgIterator::NeedsConfigure &&
Cache[Pkg].Keep() == true)
{
List->Flag(Pkg,pkgOrderList::UnPacked,pkgOrderList::States);
if (List->IsFlag(Pkg,pkgOrderList::Immediate) == true)
if (Immediate == true &&
List->IsFlag(Pkg,pkgOrderList::Immediate) == true)
if (SmartConfigure(Pkg) == false)
return _error->Error(_("Could not perform immediate configuration on already unpacked '%s'. "
"Please see man 5 apt.conf under APT::Immediate-Configure for details."),Pkg.Name());
return true;
}

VerIterator const instVer = Cache[Pkg].InstVerIter(Cache);

/* See if this packages install version has any predependencies
that are not met by 'now' packages. */
for (DepIterator D = Cache[Pkg].InstVerIter(Cache).DependsList();
for (DepIterator D = instVer.DependsList();
D.end() == false; )
{
// Compute a single dependency element (glob or)
@@ -575,20 +593,32 @@ bool pkgPackageManager::SmartUnPack(PkgIterator Pkg)

// Check for reverse conflicts.
if (CheckRConflicts(Pkg,Pkg.RevDependsList(),
Cache[Pkg].InstVerIter(Cache).VerStr()) == false)
instVer.VerStr()) == false)
return false;
for (PrvIterator P = Cache[Pkg].InstVerIter(Cache).ProvidesList();
for (PrvIterator P = instVer.ProvidesList();
P.end() == false; P++)
CheckRConflicts(Pkg,P.ParentPkg().RevDependsList(),P.ProvideVersion());

List->Flag(Pkg,pkgOrderList::UnPacked,pkgOrderList::States);

if (instVer->MultiArch == pkgCache::Version::Same)
for (PkgIterator P = Pkg.Group().PackageList();
P.end() == false; P = Pkg.Group().NextPkg(P))
{
if (Pkg == P || List->IsFlag(P,pkgOrderList::UnPacked) == true ||
Cache[P].InstallVer == 0 || (P.CurrentVer() == Cache[P].InstallVer &&
(Cache[Pkg].iFlags & pkgDepCache::ReInstall) != pkgDepCache::ReInstall))
continue;
SmartUnPack(P, false);
}

if(Install(Pkg,FileNames[Pkg->ID]) == false)
return false;

List->Flag(Pkg,pkgOrderList::UnPacked,pkgOrderList::States);
// Perform immedate configuration of the package.
if (List->IsFlag(Pkg,pkgOrderList::Immediate) == true)
if (Immediate == true &&
List->IsFlag(Pkg,pkgOrderList::Immediate) == true)
if (SmartConfigure(Pkg) == false)
return _error->Error(_("Could not perform immediate configuration on '%s'. "
"Please see man 5 apt.conf under APT::Immediate-Configure for details. (%d)"),Pkg.Name(),2);


+ 2
- 0
apt-pkg/packagemanager.h View File

@@ -69,7 +69,9 @@ class pkgPackageManager : protected pkgCache::Namespace
// Install helpers
bool ConfigureAll();
bool SmartConfigure(PkgIterator Pkg);
//FIXME: merge on abi break
bool SmartUnPack(PkgIterator Pkg);
bool SmartUnPack(PkgIterator Pkg, bool const Immediate);
bool SmartRemove(PkgIterator Pkg);
bool EarlyRemove(PkgIterator Pkg);


+ 4
- 1
debian/changelog View File

@@ -56,8 +56,11 @@ apt (0.8.14.2) UNRELEASED; urgency=low
quote an already quoted string in the request later (Closes: #602412)
* apt-pkg/contrib/netrc.cc:
- replace non-posix gnu-extension strdupa with strdup
* apt-pkg/packagemanager.cc:
- ensure for Multi-Arch:same packages that they are unpacked in
lock step even in immediate configuration (Closes: #618288)

-- David Kalnischkies <kalnischkies@gmail.com> Fri, 13 May 2011 01:08:04 +0200
-- David Kalnischkies <kalnischkies@gmail.com> Mon, 16 May 2011 11:41:05 +0200

apt (0.8.14.1) unstable; urgency=low



+ 32
- 0
test/integration/test-bug-618288-multiarch-same-lockstep View File

@@ -0,0 +1,32 @@
#!/bin/sh
set -e

TESTDIR=$(readlink -f $(dirname $0))
. $TESTDIR/framework
setupenvironment
configarchitecture 'amd64' 'i386'

insertinstalledpackage 'libsame' 'i386,amd64' '1' 'Multi-Arch: same' 'required'
insertinstalledpackage 'apt' 'i386' '1' 'Depends: libsame (= 1)
Essential: yes' 'required'
insertinstalledpackage 'apt2' 'amd64' '1' 'Depends: libsame (= 1)
Essential: yes' 'required'
buildsimplenativepackage 'libsame' 'i386,amd64' '2' 'unstable' 'Multi-Arch: same' '' 'required'
buildsimplenativepackage 'apt' 'i386' '2' 'unstable' 'Depends: libsame (= 2)' '' 'required'
buildsimplenativepackage 'apt2' 'amd64' '2' 'unstable' 'Depends: libsame (= 2)' '' 'required'

setupaptarchive

testequal 'Reading package lists...
Building dependency tree...
The following packages will be upgraded:
apt:i386 apt2 libsame libsame:i386
4 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Inst libsame [1] (2 unstable [amd64]) [libsame:amd64 on libsame:i386] [libsame:i386 on libsame:amd64] [libsame:i386 apt2:amd64 ]
Inst libsame:i386 [1] (2 unstable [i386]) [apt2:amd64 apt:i386 ]
Conf libsame:i386 (2 unstable [i386]) [apt2:amd64 apt:i386 ]
Conf libsame (2 unstable [amd64]) [apt2:amd64 apt:i386 ]
Inst apt2 [1] (2 unstable [amd64]) [apt:i386 ]
Conf apt2 (2 unstable [amd64]) [apt:i386 ]
Inst apt:i386 [1] (2 unstable [i386])
Conf apt:i386 (2 unstable [i386])' aptget dist-upgrade -s

Loading…
Cancel
Save